By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,826 Members | 815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,826 IT Pros & Developers. It's quick & easy.

WebClient Class Method=Post

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.