1

I need to post an xmlData with a prametername to a webservice. My Code is

HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;
request.Method = "POST";
StreamWriter requestWriter = new StreamWriter(request.GetRequestStream());
requestWriter.Write(doc.InnerXml);
requestWriter.Close();
HttpWebResponse response = request.GetResponse() as HttpWebResponse;

Using this I am able pass the data but parameter name is missing. So how to add a parameter name to the postdata?

Rn.
  • 157
  • 3
  • 5
  • 18

1 Answers1

1

You may send your request using Multipart form data approach, for instance you can find a sample code for it in the answer for the following question Multipart forms from C# client

Also you can try to encode your send text using UrlEncode and just send your data in the following format "fieldName=urlEncodedData"

Community
  • 1
  • 1
Victor
  • 588
  • 2
  • 11