I need to write a forms application in C# that sends parameters via HTTP POST to a url, and gets back the response.
I really don\'t realize where to start this, is i
This isn't in C# but you should be able to intepret it.
var
Bytes: Array of Byte;
Request: HttpWebRequest;
RequestStream: Stream;
Response: HttpWebResponse;
ResponseStream: StreamReader;
begin
Bytes := Encoding.UTF8.GetBytes(Data); //Where data is your data (XML in my case)
Request := WebRequest.CreateDefault(Uri.Create(URL)) as HttpWebRequest;
Request.Method := 'POST';
Request.ContentLength := Length(Bytes);
Request.ContentType := 'application/xml'; //Set accordingly
RequestStream := Request.GetRequestStream;
RequestStream.Write(Bytes, 0, Length(Bytes));
RequestStream.Close;
Response := Request.GetResponse as HttpWebResponse;
ResponseStream := StreamReader.Create(Response.GetResponseStream, Encoding.ASCII);
Result := ResponseStream.ReadToEnd;
ResponseStream.Close;
If you need clarification, let me know.
As a start please see
1- HttpWebRequest Class
2- HttpWebResponse Class
3- WebClient Class
in MSDN
Please see Here