Last post Oct 24, 2011 07:46 AM by Rajnish Kaur
Oct 20, 2011 07:07 AM|Rajnish Kaur|LINK
I want to post only string values in newwebrequest without using any stream writer in the getrequest. As am posting
data to the Jersey based services which only accept getresponseastring.
How could I do it in .Net web application OR any other way of oing it like with HTTp Client ?
Any Idea would be most welcome.
Oct 21, 2011 05:47 PM|rstrahl|LINK
Any data POSTed with HttpWebRequest requires streams. The data sent is always a binary stream which happens to be encoded as a string. Stream, string, file it all is data as far HttpWebRequest is concerned.
You can use also use System.Net WebClient.UploadString() to do simple data sends which is much easier.
+++ Rick ---
Oct 24, 2011 07:46 AM|Rajnish Kaur|LINK
HI I tried the webclient when I use its uploadstring method then It throws
Internal server error 500 Response
string response = client.UploadString("http://18.104.22.168:8080/HIS/HB/", null, "rajnish");