HTTP Posts

B

Ben

Hi,
I have several forms that need to post data to a remote site and currently
they just do a POST action with the data. I am trying to centralise the code
which manages the parameters for easier upgrade and maintenance, so i was
thinking of having all the form 'submit' buttons just pass the data to my
class which would take care of forming the Query to be sent across.

Just wondering, to make this call (HTTP POST) should i use some HttpRequest
classes? and will i get error responses (if any) from the remote server that
I can parse?

Any thoughts ?

cheers
ben
 
B

Ben

I think I have it ... I could use the WebClient class ..

But does the approach make sense ? id rather keep the presentation layer
separate from any communications with backend systems and thought this might
be a good way to do it ..

Thanks
 
R

Rick Strahl [MVP]

It's common to do this in this fashion. WHy do you worry about this
approach? The only issue you might have is that this request might be slow
and tying up one of ASP.Net's threads for a period of time.

If you can do without knowing hte result of the remote operation you can
maybe run it on a separate thread and just let it die or use asynchronous
ASP.Net requests. This would only make sense though if there's a performance
problem in the first palce.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top