473,385 Members | 1,813 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,385 software developers and data experts.

WebClient Class Method=Post

I am sending and receiving multipart messages using the WebClient UploadData
method Method=Post. Everything seems to work well except when the URL
contains parameters. For example:
http://www.someURL.com?parm1=data1&parm2=data2. I don't believe these
paramters are transmitted as part of the URL with the HTTP Post interface. I
was under the impression that the WebClient class automatically handled
these parameters for POST. The documentation doesn't cover this. Is this
correct? If not, how should the user handle them. Please advise. Thanks
for your help.

Best Regards,

Paul J. Lay

Nov 18 '05 #1
4 10303
method POST - access the posted variables using html form (like
Request.Form). in this case the values have to be part of the Form.
method GET - access the posted variables using Request.QueryString[]

Av.

"Paul J. Lay" <pj***@msn.com> wrote in message
news:u0**************@TK2MSFTNGP09.phx.gbl...
I am sending and receiving multipart messages using the WebClient
UploadData
method Method=Post. Everything seems to work well except when the URL
contains parameters. For example:
http://www.someURL.com?parm1=data1&parm2=data2. I don't believe these
paramters are transmitted as part of the URL with the HTTP Post interface.
I
was under the impression that the WebClient class automatically handled
these parameters for POST. The documentation doesn't cover this. Is this
correct? If not, how should the user handle them. Please advise. Thanks
for your help.

Best Regards,

Paul J. Lay

Nov 18 '05 #2
If you using POST method parameters are not attached to URL.
They only attached to URL when using GET
With WebClient you suppose to use method UploadData but i have never been
using it.

I have always been using HttpWebRequest for that type of jobs. This class
seems to be more flexible.

George.
"Paul J. Lay" <pj***@msn.com> wrote in message
news:u0**************@TK2MSFTNGP09.phx.gbl...
I am sending and receiving multipart messages using the WebClient UploadData method Method=Post. Everything seems to work well except when the URL
contains parameters. For example:
http://www.someURL.com?parm1=data1&parm2=data2. I don't believe these
paramters are transmitted as part of the URL with the HTTP Post interface. I was under the impression that the WebClient class automatically handled
these parameters for POST. The documentation doesn't cover this. Is this
correct? If not, how should the user handle them. Please advise. Thanks
for your help.

Best Regards,

Paul J. Lay

Nov 18 '05 #3
I believe I have it figured out using multipart requests. There is one post
parameter per part. I understand that and it is working well. Now I have
many non multipart POST requests from internet explorerer. That is just a
simple message comtaining parm data pairs, i.e.
parm1=data1&parm2=data2&parm3=data3.. I believe it is substring after the
? character on a get request. The browser only sends these data pairs in
that mode. Suppose you want to send user data after the parm data. Is this
possible? If so, what delimits the last parm data pair from the start of
the user data? I am confused on this point. Any ideas?

Best Regards,

Paul J. Lay

"George Ter-Saakov" <no****@hotmail.com> wrote in message
news:OV*************@TK2MSFTNGP11.phx.gbl...
If you using POST method parameters are not attached to URL.
They only attached to URL when using GET
With WebClient you suppose to use method UploadData but i have never been
using it.

I have always been using HttpWebRequest for that type of jobs. This class
seems to be more flexible.

George.
"Paul J. Lay" <pj***@msn.com> wrote in message
news:u0**************@TK2MSFTNGP09.phx.gbl...
I am sending and receiving multipart messages using the WebClient UploadData
method Method=Post. Everything seems to work well except when the URL
contains parameters. For example:
http://www.someURL.com?parm1=data1&parm2=data2. I don't believe these
paramters are transmitted as part of the URL with the HTTP Post interface. I
was under the impression that the WebClient class automatically handled
these parameters for POST. The documentation doesn't cover this. Is

this correct? If not, how should the user handle them. Please advise. Thanks for your help.

Best Regards,

Paul J. Lay


Nov 18 '05 #4
Paul J. Lay wrote:
I believe I have it figured out using multipart requests. There is
one post parameter per part. I understand that and it is working
well. Now I have many non multipart POST requests from internet
explorerer. That is just a simple message comtaining parm data
pairs, i.e. parm1=data1&parm2=data2&parm3=data3.. I believe it is
substring after the ? character on a get request. The browser only
sends these data pairs in that mode. Suppose you want to send user
data after the parm data. Is this possible? If so, what delimits
the last parm data pair from the start of the user data? I am
confused on this point. Any ideas?


What you're describing is the MIME type application/x-www-form-urlencoded --
that is used for "normal" web forms. No, there's no way to add more
information other than the key/value pairs contained in the request body.
Also note that it is perfectly legal to POST data to a URI that contains a
query string, like

POST /application/foo?bar=1 HTTP/1.1
[Headers...]

a=x&b=y

The serverside should pick up all parameters, regardless of their true
origin (form values, query string). Following up on the previous example,
that means that serverside code should be able to retrieve
a=x
b=y
bar=1
Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #5

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

Similar topics

2
by: Rob | last post by:
THis is my code. What im trying to accomplish is the user fills out the form then when they hit submit it displays what the entered on the samne page but i get this error message when I hit submit...
3
by: Armin Irger | last post by:
Hi, i'am running a debian sarge with the delivered apache2 mysql and php4. The file "mitarbeiter_eingabe.php" gets the data over a html <FORM> and send it to...
5
by: phil | last post by:
This is a quick plea on something that has me stumped. I have a python script importing "cgi" I developed my script on a local machine using method = get for uploading form data. My code...
2
by: Heinrich Klein | last post by:
Hello I have got an the Unload Handler is it possible when the Browser is closed to send a Method post to a CGI program? If yes how can i do this normally i need to push a Button. Thanks for...
4
by: Don | last post by:
How do I retrieve URL parameters via html, where they were provided from a <form method=post...>? Thanks in advance, Don -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----...
1
by: Adnan Selimovic | last post by:
Hi folks! I tried to post a web form using the WebClient class and HttpWebRequest/HttpWebResponse. It didn't work for the ASPX web pages. I always got an unposted version - like if I had just made...
12
by: Britney | last post by:
Hi guys, in my default.aspx file, I have following code. when I go to browser, I enter values in both textboxs, then I hit submit Button, however, it didn't go to page2.aspx. instead, it was...
11
by: =?Utf-8?B?QkxVRVNUQVI=?= | last post by:
Here is the link of the website http://www.smartcharlotte2050.com/YourThoughts.asp I have been told to change only the form action part of this site.which is to "response.asp" Here the method...
4
by: codyshea2000 | last post by:
this is my html /php form but every time i click submit it says the metod post is not alowed how can i fix this <!-- Form made by cody.m --> <center> <FORM METHOD="POST" ACTION="test.php"> ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
Oralloy
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,...
0
jinu1996
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...

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.