473,320 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

POST without a Page

I have a bunch of variables (properties of an object) stored in the Session,
and need to send them to another Web site via an HTTP POST.

The receiving site is expecting the name/values pairs in an HTML <FORM>. The
documentation for the receiving site assumes a page is being POSTed - but it
only really cares about the FORM being received in the POST.

I was thinking I could simply build the <FORM> as a string that then gets
sent via the POST. I would like to do this work (build the string and send
via POST) from a static class.

I can build the string - but how can I POST to the other Web site? I've seen
the WebClient object in .NET - but don't know if that's suitable for my
purposes or if there are alternatives I should consider.

Any perspective on the WebClient class or alternatives for how to accomplish
this are appreciated.
Nov 19 '05 #1
7 1057
"Jordan" <A@B.com> wrote in news:#T*************@tk2msftngp13.phx.gbl:

I have a bunch of variables (properties of an object) stored in the
Session, and need to send them to another Web site via an HTTP POST.


Can you use a web service instead?

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com
Nov 19 '05 #2
<< Can you use a web service instead? >>

Not sure - all I know is the receiver (which is way beyond my control) is
expecting an HTTP POST. I guess if a web service can send a POST then I
might be able to use a Web service - but I know practically nothing about
web services.
Nov 19 '05 #3
WJ
This may help you (Listing 2 is what you need):
http://www.west-wind.com/presentatio...WebRequest.htm

"Jordan" <A@B.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
<< Can you use a web service instead? >>

Not sure - all I know is the receiver (which is way beyond my control) is
expecting an HTTP POST. I guess if a web service can send a POST then I
might be able to use a Web service - but I know practically nothing about
web services.

Nov 19 '05 #4
Thanks! I did this before in COM via the WinSock API. I've been using .NET
long enough to know something this straight-forward just had to exist; but
the WebClient class just didn't seem like what I needed.


"WJ" <Jo*******@HotMail.Com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
This may help you (Listing 2 is what you need):
http://www.west-wind.com/presentatio...WebRequest.htm

"Jordan" <A@B.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
<< Can you use a web service instead? >>

Not sure - all I know is the receiver (which is way beyond my control) is
expecting an HTTP POST. I guess if a web service can send a POST then I
might be able to use a Web service - but I know practically nothing about
web services.


Nov 19 '05 #5
"Jordan" <A@B.com> wrote in news:#D**************@TK2MSFTNGP14.phx.gbl:
Not sure - all I know is the receiver (which is way beyond my control)
is expecting an HTTP POST. I guess if a web service can send a POST
then I might be able to use a Web service - but I know practically
nothing about web services.


A web service is basically a remote procedure call using SOAP (XML) via
some sort of transport mechanism (typically HTTP).

It's great for what you want to do - sending data to a remote point and
getting a return value. Not to mention, a web service is probably more
reliable than a straight post, easier to manage, easier to maintain, easier
to code, cross platform/client compatible... and the list goes on!

You might want to mention it to the other party invovled (if this post
mechanism is not in place yet). A web service project is extremely easy to
build in .NET - just start a new web service project and you'll see what I
mean : )

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
Horrible experience at Newmarket Volvo:
http://newmarketvolvo.tripod.com
Nov 19 '05 #6
If you still can't find a suitable answer, perheps you can try NUnit for
ASP.NET. I remembered there's a class that can be used for POSTing requests.

But since this library is built for testing purpose, I'm not sure whether
you'll have other cases to consider or not.

"Jordan" <A@B.com> ¼¶¼g©ó¶l¥ó·s»D:O7**************@TK2MSFTNGP15.phx.g bl...
Thanks! I did this before in COM via the WinSock API. I've been using .NET
long enough to know something this straight-forward just had to exist; but
the WebClient class just didn't seem like what I needed.


"WJ" <Jo*******@HotMail.Com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
This may help you (Listing 2 is what you need):
http://www.west-wind.com/presentatio...WebRequest.htm

"Jordan" <A@B.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
<< Can you use a web service instead? >>

Not sure - all I know is the receiver (which is way beyond my control)
is expecting an HTTP POST. I guess if a web service can send a POST then
I might be able to use a Web service - but I know practically nothing
about web services.



Nov 19 '05 #7
use the webclient class and UploadValues method.

-- bruce (sqlwork.com)
"Jordan" <A@B.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I have a bunch of variables (properties of an object) stored in the
Session, and need to send them to another Web site via an HTTP POST.

The receiving site is expecting the name/values pairs in an HTML <FORM>.
The documentation for the receiving site assumes a page is being POSTed -
but it only really cares about the FORM being received in the POST.

I was thinking I could simply build the <FORM> as a string that then gets
sent via the POST. I would like to do this work (build the string and send
via POST) from a static class.

I can build the string - but how can I POST to the other Web site? I've
seen the WebClient object in .NET - but don't know if that's suitable for
my purposes or if there are alternatives I should consider.

Any perspective on the WebClient class or alternatives for how to
accomplish this are appreciated.

Nov 19 '05 #8

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

Similar topics

5
by: Belinda | last post by:
Hello All I have the following test.asp page which needs one parameter querystr but my querystr is a very long string value. When I send a long value the query string is getting truncated after...
3
by: Troy | last post by:
Hello- I have a website that uses a custom built webserver to serve the pages. (Please don't ask me why my boss had his own web server written). I am displaying a log of information that is an...
8
by: Victor | last post by:
I need to redirect to another web page, but that redirect will include the submission of form data. So, unlike ServerXMLHTTP which stays on the originating web page, I need the script to redirect...
3
by: Alex | last post by:
Hi!! i have a major problem, and i've been searching for a solution for about 2 weeks, but havent found one. i have to do a POST-Request to a server, but the server shouldnt know my referrer....
3
by: kaushalmbhavsar | last post by:
I am working on one VB.NET application where I am using WinHttp.dll to post request on website. First request is for Login Page and I have gone through all input types of that page and pass those...
1
by: Mad Scientist Jr | last post by:
How do you get a ASP.NET page to return nothing, so the page posting form data to it doesn't reload? I have tried all combinations of the following: Response.SuppressContent = True...
2
by: Matt | last post by:
When we submit the form data to another page, we usually do the following: <form action="display.aspx" method="post"> will submit the form data and open display.asp in the current browser ...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
3
by: Jag | last post by:
Hi I am facing a strange issue. I have 3 ASP pages in the default website 1. auth.aspx <html> <body>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.