415 Unsupported Media type on Httpwebrequest.Getresponse -


i trying user profile data microsoft's live api performing httpwebrequest https://apis.live.net/v5.0/me?access_token=myaccesstoken

however i'm getting unsupported media type error on getresponse().i thought might have been content-type, returns application-json in postman. here's code:

var request =(httpwebrequest)httpwebrequest.create(string.format(@"https://apis.live.net/v5.0/me?access_token=" + smyaccesstoken)); request.contenttype = "application/json"; request.method = "get";   using (httpwebresponse response = request.getresponse() httpwebresponse) {     using (streamreader reader = new streamreader(response.getresponsestream()))     {         var content = reader.readtoend();         dynamic result = jsonconvert.deserializeobject<dynamic>(content);          if (result == null)         {             return null;         }          newtonsoft.json.linq.jobject socialprofileaccountresultjson = new newtonsoft.json.linq.jobject         {             ["firstname"] = result.first_name,             ["surname"] = result.last_name,             ["profilepictureurl"] = sprofilepictureurl         };          return socialprofileaccountresultjson;     } } 


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -