POST/GET from windows form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,
I need to pass a series of parameters to an SMS gateway from a client
application, a windows form application. The question is, HOW?
Is it possible to POST/GET data from a windows form?
Do people use Remoting or Socket to this pourpose?
Thanks a lot.
 
No need to use sockets directly. :8-)

You can use HttpWebRequest class, which is located in System.Net namespace.

send request to the server, using HTTP protocol

//send request
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(http://smsgate.net);

//get response
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse ();

watch the docs for the details.
 
Thanks Vadmyst,

all more clear, now!

Matteo

Vadym Stetsyak said:
No need to use sockets directly. :8-)

You can use HttpWebRequest class, which is located in System.Net namespace.

send request to the server, using HTTP protocol

//send request
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(http://smsgate.net);

//get response
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse ();

watch the docs for the details.
 
Vadym said:
No need to use sockets directly. :8-)

You can use HttpWebRequest class, which is located in System.Net
namespace.

send request to the server, using HTTP protocol

//send request
HttpWebRequest myReq =
(HttpWebRequest)WebRequest.Create(http://smsgate.net);

//get response
HttpWebResponse response = (HttpWebResponse)myReq.GetResponse ();

watch the docs for the details.

You can use System.Net.WebClient as well, which is more user-friendly
for basic HTTP operations.

Cheers,
 
Back
Top