- Home /
Question by
ArseneySorokin · Aug 25, 2019 at 01:35 PM ·
wwwform
UnityWebRequest authentication
Hello,
I am trying to access the Sendgrid API using UnityWebRequest but I keep getting the "HTTP/1.1 401 Unauthorized" error.
As a matter of fact, I am getting this error no matter the service I attempt.
My code is:
string authKey = "Bearer " + System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(key));
form.headers.Add("authorization", authKey);
I then use this form in my Post request.
What am I doing wrong?
Comment
Have you tried capitalizing the "authorization" in the form.headers.Add? Usually, that is capitalized in API requests.
Your answer
Follow this Question
Related Questions
A login system with www and ruby on rails? 1 Answer
WWWForm.AddBinaryData() clears post and file data. 1 Answer
Use variable from another script with WWW give NULL? 1 Answer
How do I make a simple POST request to Amazon S3? 2 Answers
Blank web server response in multiple type data submission 1 Answer