473,505 Members | 16,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP Posts

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


Nov 18 '05 #1
4 1294
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

"Ben" <benjy@allfreetech[DOT]com> wrote in message
news:ul*************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #2
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
----------------------------------
Making waves on the Web
"Ben" <benjy@allfreetech[DOT]com> wrote in message
news:ul*************@TK2MSFTNGP11.phx.gbl...
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

Nov 18 '05 #3
Ben
Thanks Rick... I havent tried this kind of abstraction in the past so I was
wondering if its a common thing to do.

actually these forms POST search keywords to a third party sitesearch
service which responds to the query string by generating a HTML page with
the search results. I guess i cant do the asynchronous approach since the
user will push the button and wait for the search results page.

Cheers
Ben
"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
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
----------------------------------
Making waves on the Web
"Ben" <benjy@allfreetech[DOT]com> wrote in message
news:ul*************@TK2MSFTNGP11.phx.gbl...
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


Nov 18 '05 #4
Ben,

Unless you have load issues in terms of high traffic load and the requests
take a long time to complete I wouldn't really worry about this. If you do
you can look into Async HTTP requests on the server which will leave you to
process without tieing up ASP.Net's thread process pool.

There was a detailed article in MSDN magazine on this topic a few months:

http://msdn.microsoft.com/msdnmag/is...g/default.aspx

At the very end of the article it talks exactly about how to implement ASPX
pages that run async by implenting IHttpAsyncHandler in your page (or
creating a custom page class that supports it).

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/wwHelp
----------------------------------
Making waves on the Web
"Ben" <benjy@allfreetech[DOT]com> wrote in message
news:uw**************@TK2MSFTNGP12.phx.gbl...
Thanks Rick... I havent tried this kind of abstraction in the past so I was wondering if its a common thing to do.

actually these forms POST search keywords to a third party sitesearch
service which responds to the query string by generating a HTML page with
the search results. I guess i cant do the asynchronous approach since the
user will push the button and wait for the search results page.

Cheers
Ben
"Rick Strahl [MVP]" <ri********@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...
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
----------------------------------
Making waves on the Web
"Ben" <benjy@allfreetech[DOT]com> wrote in message
news:ul*************@TK2MSFTNGP11.phx.gbl...
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



Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1625
by: normd | last post by:
Am I doing something dumb? Ween searching for posts in this system I enter words from my posts - that I know are in there - and the search keeps coming back with nothing found. I entered the...
16
2575
by: Andy Lai | last post by:
Hi, I am writing a C++ program which needs to post an XML to an HTTP server periodically and the program will run on different platforms including w32, linux, and unix. I see that there are...
1
1089
by: Jay | last post by:
After upgrading from VS 2003 to VS 2005, my stable VB client code that posts xml over http to an aspx page stopped working. Somehow, asp.net (or IIS) is expecting the root url to be...
3
1772
by: Matt | last post by:
Hi, I am trying to to create a HTTP Request that posts XML that mimics the html form below. <form name="Form1" method="post" action="http://test/xml.aspx" id="Form1"> <textarea...
3
2134
by: webEater | last post by:
Hey, I am writing a file that reads in an external file in the web and prints it out including the response header of the http protocol. I do this to enable cross domain XMLHttpRequests. I...
31
2885
by: Sam of California | last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing of the source file"? I responded to that comment by saying that the preprocessor is not just a pass. It processes...
10
6954
by: marss | last post by:
<hr style="height:1px"/does not fit because although a line looks like it has 1 pixel with but there are empty spaces above and below line. It can be seen if place two HR elements beside. <hr...
13
5088
by: trpost | last post by:
I am looking for a way to send data from one page to another as POST data without using forms or cURL. I have a php script that is passing a list of cases from on page to another when a link is...
21
2759
by: mark | last post by:
Hello, I want to create a php scraper that will get some information from e.g. 5 sites simultaneously. I tried the following script:...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.