You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(accessControlUri);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.KeepAlive = true;
string token = null;
//Note: You need to insert your client Id and secret into this string in order for it to work.
var requestBytes = Encoding.ASCII.GetBytes("grant_type=client_credentials&client_id=" + clientId + "&client_secret=" + HttpUtility.UrlEncode(clientSecret) + "&scope=urn%3a" + scope);
request.ContentLength = requestBytes.Length;
// Write the request data to the request stream
var requestStream = request.GetRequestStream();
requestStream.Write(requestBytes, 0, requestBytes.Length);
requestStream.Close();
// Get the response back from the server
var response = (HttpWebResponse)request.GetResponse();
Thank you for reviewing my issue. Any help will be welcome.
The text was updated successfully, but these errors were encountered:
I test the code from https://github.com/Azure/azure-sdk-for-media-services/blob/dev/samples/MediaServicesRESTSample/RESTAPISamples/RESTAPISamples/Program.cs, I get error
An unhandled exception of type 'System.Net.WebException' occurred in System.dll.Additional information: The remote server returned an error: (400) Bad Request.
when running the code below:Thank you for reviewing my issue. Any help will be welcome.
The text was updated successfully, but these errors were encountered: