Closed ddineen closed 6 years ago
Hi,
How Do you call the service?
In Asp.NET - this worked for me. The issue was related to the custom headers <add name="Access-Control-Allow-Headers" value="content-type .... Then the following code worked out fine.
string Url = rootUrl + "/umbraco/oauth/token";
string paramaters = "grant_type=password&username=" + siteSettings.GetApiUsername() + "&password=" + siteSettings.GetApiPassword();
string contentType = "application/x-www-form-urlencoded";
string sResponse = "";
wc.Headers.Add("Content-Type", contentType);
Uri u = new Uri(Url);
sResponse = await wc.UploadStringTaskAsync(u, "POST", paramaters);
Hope this helps!
Getting this when i post to oauth/token "Message": "The request entity's media type 'application/x-www-form-urlencoded' is not supported for this resource."
Umbraco 7.7.1