473,785 Members | 2,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10320
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.QuerySt ring[]

Av.

"Paul J. Lay" <pj***@msn.co m> wrote in message
news:u0******** ******@TK2MSFTN GP09.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.co m> wrote in message
news:u0******** ******@TK2MSFTN GP09.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&par m2=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******** *****@TK2MSFTNG P11.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.co m> wrote in message
news:u0******** ******@TK2MSFTN GP09.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&par m2=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
13832
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 Method Not Allowed The requested method POST is not allowed for the URL /rob.html. Here is the code. Any helpis greatly appreciated I cant figure this out at all i have tried so many different combinations.
3
6614
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 "mysql_mitarbeiter_daten_hinzufuegen.php" to write it in an mysql database. These already worked on php3 and mysql-3 and now on php4 and mysql4 it doesn't work. I can't found any changes between php3 and php4, mysql3 and mysql4 that explained the fact that only empty spaces are...
5
5122
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 worked locally and on the hosting service I'm using. I changed to using method = post
2
2839
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 your help
4
11846
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 =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
1
2982
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 a simple request without posting anything. I have written the same thing using the Perl's LWD::UserAgent class and it was the same. The web form is really very simple. As soon as I created the ASP file with the same form everything worked! Does...
12
1960
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 still in default page. I thought Action will direct page to page2.aspx, no??? <form id="Form1" method="post" runat="server" action="page2.aspx"> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox>
11
2832
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 POST is not working,and I dont know how to solve this problem I have tried making my own sample. asp page with 4 textareas as in YourThoughts.asp,and also I have kept the textarea name and ID same as that.
4
2687
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"> <font color="red">*</font>First Name: <INPUT TYPE="text" VALUE="Joe king" SIZE="20" onFocus="this.value=''"> <font color="red">*</font>E-Mail: <INPUT TYPE="text" VALUE="removed email address" SIZE="30" onFocus="this.value=''">
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 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...
1
10085
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,...
0
9947
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
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...
1
7494
isladogs
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...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.