headers
(Read Only) Returns the correct request headers for posting the form using the WWW class.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Property
- Namespace: UnityEngine
- Assembly: UnityEngine.UnityWebRequestModule
public Dictionary<string, string> headers { get; }
Remarks
This field only contains one header, /"Content-Type"/, which is set to the correct mime type for the form: "" for normal forms and "" for forms containing data added using WWWForm.AddBinaryData.
application/x-www-form-urlencodedmultipart/form-dataExamples
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); }}