Quantcast
Channel: Questions in topic: "webrequest"
Viewing all articles
Browse latest Browse all 387

Pass Header Data in UnityWebRequest

$
0
0
I want to pass header information to my web service call. I have following code to use but don't know how to pass header data with same request. void Start () { StartCoroutine (LoadLoginInfo ()); } IEnumerator LoadLoginInfo () { Debug.Log("Load Login Info"); WWWForm form = new WWWForm (); form.AddField ("username", "admin"); form.AddField ("password", "Admin123#"); UnityWebRequest www = UnityWebRequest.Post (url, form); yield return www.Send(); if (www.isError) { Debug.Log (www.error); } else { Debug.Log ("Data: " + www.downloadHandler.text); } } Please give me some help in this.

Viewing all articles
Browse latest Browse all 387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>