Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > WebClient Class Method=Post

Reply
Thread Tools

WebClient Class Method=Post

 
 
Paul J. Lay
Guest
Posts: n/a
 
      05-13-2004
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



 
Reply With Quote
 
 
 
 
avnrao
Guest
Posts: n/a
 
      05-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>
>
>



 
Reply With Quote
 
 
 
 
George Ter-Saakov
Guest
Posts: n/a
 
      05-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Paul J. Lay
Guest
Posts: n/a
 
      05-13-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >
> >

>
>



 
Reply With Quote
 
Joerg Jooss
Guest
Posts: n/a
 
      05-15-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebClient Class throwing exception =?Utf-8?B?RGVlcHNvbiBUaG9tYXM=?= ASP .Net 3 06-25-2007 10:02 AM
Are there bugs or something in the Webclient class? Brent ASP .Net 0 10-26-2005 12:50 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
can Webclient class be used with Asp.net Session? =?Utf-8?B?QXJuZQ==?= ASP .Net 6 10-08-2004 07:59 PM
WebClient Class / Upload File / IIS 405 Error Grant Harmeyer ASP .Net 4 09-08-2004 11:25 AM



Advertisments