Last post Dec 07, 2011 09:15 PM by Decker Dong - MSFT
Dec 06, 2011 05:19 AM|RizwanAnsari|LINK
i have an xml request to send over http,for example
WebRequest request = WebRequest.Create(xmlreq); request.Method = "POST"; string postData = xmlreq; byte byteArray = Encoding.UTF8.GetBytes(postData); request.ContentType = "application/xml"; request.ContentLength = byteArray.Length; Stream dataStream = request.GetRequestStream(); dataStream.Write(byteArray, 0, byteArray.Length); dataStream.Close(); WebResponse response = request.GetResponse();
i am getting error remote server returned error:405 method not allowed.
but when i paste in browser there is no problem.
can anybode help me to solve this issue.
Dec 06, 2011 06:05 AM|Pankaj.Sharma|LINK
Check the links below if they could help you out.
Dec 07, 2011 09:15 PM|Decker Dong - MSFT|LINK
As far as I see，the error usually happens when your request.Method is wrong，or something related to this。So plz make sure that your request's method matches what it is——please change it from post to get and have a try。