Performing a POST from asp(.net) ?

  • Thread starter Thread starter +Bob+
  • Start date Start date
B

+Bob+

Does ASP and/or ASP.net have any modules that can be used to perform
HTTP POSTs to web pages and forms?

This would be an application where there would be one form for the end
user to fill out - then the called asp(.net) program would set up the
data to be passed by POST (HTTP Headers) and call the ASP or CGI that
further processes the data.

Thanks,
 
Does ASP and/or ASP.net have any modules that can be used to perform
HTTP POSTs to web pages and forms?

This would be an application where there would be one form for the end
user to fill out - then the called asp(.net) program would set up the
data to be passed by POST (HTTP Headers) and call the ASP or CGI that
further processes the data.

Thanks,

Look at the HttpWebRequest

HttpWebRequest request =
(HttpWebRequest)HttpWebRequest.CreateDefault(url);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.ContentLength = ...;

and so forth
 
+Bob+ said:
Does ASP and/or ASP.net have any modules that can be used to perform
HTTP POSTs to web pages and forms?

This would be an application where there would be one form for the end
user to fill out - then the called asp(.net) program would set up the
data to be passed by POST (HTTP Headers) and call the ASP or CGI that
further processes the data.

Thanks,

You can use the HttpWebRequest class or the WebClient class to post data.

If you have any control over how the server will recieve the data, you
should consider setting up a web service instead of using HTTP posts. In
ASP.NET you can add a reference to a web service, and it automatically
creates a class with methods that you can use to call the web service.
 
You can use the HttpWebRequest class or the WebClient class to post data.

If you have any control over how the server will recieve the data, you
should consider setting up a web service instead of using HTTP posts. In
ASP.NET you can add a reference to a web service, and it automatically
creates a class with methods that you can use to call the web service.

Thanks... I'm calling to other people's forms, so I have no control
over the server.
 
Look at the HttpWebRequest

HttpWebRequest request =
(HttpWebRequest)HttpWebRequest.CreateDefault(url);
request.ContentType = "application/x-www-form-urlencoded";
request.Method = "POST";
request.ContentLength = ...;

and so forth

Thanks.
 
Back
Top