I need to consume a restful webservice using .net 2.0 framework and not by using WCF. The RESTFul service is built in java and is designed only for POST operations. To consume the webservice in winforms in .net I am using a WebClient object.
Below is the sample code
string data="some data";
string url="some uri";
WebClient request = new WebClient();
//Application throws internal server error 500 at runtime when it hits this line.
string results = request.UploadString(url, "POST", data);
Is there anything wrong that i am doing here ? any help in this regard is greatly appreciated.
Are you sure that the service method in question accepts plain-text data and not something structured like JSON or XML/SOAP?