Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.
Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.
CerrarPor alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.
Cerrar(Read Only) Returns the correct request headers for posting the form using the WWW class.
This field only contains one header, /"Content-Type"/,
which is set to the correct mime type for the form: "application/x-www-form-urlencoded
" for normal
forms and "multipart/form-data
" for forms containing data added using AddBinaryData.
var form = new WWWForm(); form.AddField("name","value"); var headers = form.headers; var rawData = form.data; var url = "www.myurl.com";
// Add a custom header to the request. // In this case a basic authentication to access a password protected resource. headers["Authorization"]="Basic " + System.Convert.ToBase64String( System.Text.Encoding.ASCII.GetBytes("username:password"));
// Post a request to an URL var www = new WWW(url, rawData, headers); yield www; //.. process results from WWW request here...
WWWForm form = new WWWForm(); form.AddField( "name", "value" ); Hashtable headers = form.headers; byte[] rawData = form.data; string url = "www.myurl.com";
// Add a custom header to the request. // In this case a basic authentication to access a password protected resource. headers["Authorization"] = "Basic " + System.Convert.ToBase64String( System.Text.Encoding.ASCII.GetBytes("username:password"));
// Post a request to an URL with our custom headers WWW www = new WWW(url, rawData, headers); yield return www; //.. process results from WWW request here...