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 4 1306
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@allfreet ech[DOT]com> wrote in message
news:ul******** *****@TK2MSFTNG P11.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
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@allfreet ech[DOT]com> wrote in message
news:ul******** *****@TK2MSFTNG P11.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
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********@hot mail.com> wrote in message
news:e5******** ******@TK2MSFTN GP10.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@allfreet ech[DOT]com> wrote in message news:ul******** *****@TK2MSFTNG P11.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
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 IHttpAsyncHandl er 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@allfreet ech[DOT]com> wrote in message
news:uw******** ******@TK2MSFTN GP12.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********@hot mail.com> wrote in message news:e5******** ******@TK2MSFTN GP10.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@allfreet ech[DOT]com> wrote in message news:ul******** *****@TK2MSFTNG P11.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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 original; I KNOW it is there
Further, I search, as a test, for posts I'm looking at on the screen and using words from their subject line, and it tells me "nothing found!
Is there a way to find posts from an author without starting with a post from...
|
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 some library available out there including cURL
and Libwww from w3c. I will spend some time on them myself but if
anyone are familiar with them, please share know how good they
compile/run on different platforms. Also, if there is a better HTTP
|
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 http://www.w3.org/2001/XMLSchema, not
http://www.w3.org/2000/10/XMLSchema as shown below.
<root xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" <root
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Is there a way to tell asp.net or IIS which xml version it...
|
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 name="OrderXml" id="OrderXml"
style="height:342px;width:550px;Z-INDEX: 104; LEFT: 65px; POSITION:
absolute; TOP: 84px" rows="1" cols="20"></textarea>
<p>
|
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 implemented it via fsockopen, like this:
<?
$url = $_REQUEST; // take the param as $uri
//... more ...
| |
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 statements that the compiler does not process. The good
people in the alt.comp.lang.learn.c-c++ newsgroup insist that the
preprocessor is just one of many passes. The preprocessor processes a
grammer unique to the preprocessor and only that grammer.
...
|
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 style="height:1px"/>
<hr style="height:1px"/>
I tried also <div style="height:1px;font-size:1px;background-
color:black;"></divbut a line was 2 pixel thick :(
|
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 clicked. This is working fine for the most part
as a link, but sometimes the list gets very large and gets cut off.
The reason it gets cut off appears to be a limitation on the amount of
data that can be passesd in the URI.
It looks like I can...
|
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:
http://www.phpied.com/simultaneuos-http-requests-in-php-with-curl/
Everything works fine, but what I want is simultaneuos (something to
multithread, when these 5 websites will be loaded not one after
another, but by using different sockets) scraper.
In addition I would like to display the results as soon...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |