- Home /
Calling API via proxy
Hi,
I have a problem with calling API.
this got error when I was trying to call: "You are trying to load data from a www stream which had the following error when downloading. 407 Proxy Authentication Required"
The cause of this error is my API url needed auth with certain user name and password before accessing API.
I've setting up my code below:
WWWForm form = new WWWForm ();
Hashtable headers = form.headers;
headers["Proxy-Authorization"] = "Basic " + System.Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes("username:password"));
form.AddField ("data", myData);
WWW www = new WWW (API_URL, form.data, headers);
yield return www;
Debug.Log (www.text);
can anyone help me pass..! Thanks.
Comment
Your answer
Follow this Question
Related Questions
Unable to call external API (IBM Watson) via HTTP request? 1 Answer
Coroutine for WWW call not resuming 0 Answers
Use the data received from WWW in UI 1 Answer
Getting info using WWW & PHP 3 Answers
WWW class does not work 1 Answer