(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.
#pragma strict public class Example extends MonoBehaviour { function Start() { var headers: Dictionary.<String,String> = new Dictionary.<String,String>(); headers.Add("header-name", "header content"); var www: WWW = new WWW("https://example.com", null, headers); wwwDebug.Log(www.text); } }
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class Example : MonoBehaviour {
IEnumerator Start () { Dictionary<string, string> headers = new Dictionary<string,string>(); headers.Add("header-name", "header content"); WWW www = new WWW("https://example.com", null, headers); yield return www; Debug.Log (www.text); }
}