WWWForm.headers Manual     Reference     Scripting  
Scripting > Runtime Classes > WWWForm

var headers : Hashtable


(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();
var headers=form.headers;
var rawData=form.data;

// 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(

// Post a request to an URL
var www = new WWW(url, rawData, headers);
yield www;
//.. process results from WWW request here...