Author: kushalrdalal | Posted on: 3/4/2010 1:18:49 PM | Views : 303

I am making a put call for rest api for sending xml data and once that is successful i should get response in xml.
I am getting error -
WebException: ProtocolError With response: The remote server returned an error: (415) Unsupported Media Type.
Does any body know what i am doing wroing?
My code is as follow -
Uri address = new Uri("https://tem.test.mysite.com/Portal/api/oms/asn/v1?email=myemail@mysite.com&password=mypassword"); HttpWebRequest request = WebRequest.Create(address) as HttpWebRequest; //request.Credentials = new NetworkCredential(CCAPIKey + "%" + CCLoginName, CCLoginPassword); request.Credentials = new NetworkCredential("myemail@mysite.com", "mypassword"); request.Method = "PUT"; request.ContentType = "application/atom+xml"; ...

Go to the complete details ...