473,804 Members | 3,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Receiving '+' character in Request.Form

I'm sending some data in a HTTP POST to an asp page. The data contains
some + characters. When I try to access the data using
Request.Form("d ata") I get the data but the + characters are replaced
by spaces.

Any ideas?

Jul 4 '07 #1
5 2046
wrote on 04 jul 2007 in microsoft.publi c.inetserver.as p.general:
I'm sending some data in a HTTP POST to an asp page. The data contains
some + characters. When I try to access the data using
Request.Form("d ata") I get the data but the + characters are replaced
by spaces.
Not true!

Try:

=========== test.asp ===========

<% = request.form("t ")%>

<form method='post'>
<input name='t' value='a+b+c'>
<input type='submit'>
</form>

=============== =============== ==
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '07 #2
fe*********@hot mail.com wrote:
I'm sending some data in a HTTP POST to an asp page. The data contains
some + characters. When I try to access the data using
Request.Form("d ata") I get the data but the + characters are replaced
by spaces.
Please post a simple page that reproduces the symptoms you are experiencing.
"+" characters should not be replaced.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 4 '07 #3
On Jul 4, 9:32 pm, "Bob Barrows [MVP]" <reb01...@NOyah oo.SPAMcom>
wrote:
fergally...@hot mail.com wrote:
I'm sending some data in a HTTP POST to an asp page. The data contains
some + characters. When I try to access the data using
Request.Form("d ata") I get the data but the + characters are replaced
by spaces.

Please post a simple page that reproduces the symptoms you are experiencing.
"+" characters should not be replaced.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Thanks for you help. I tried that example and I see now that they
should not be replaced. I better explain in more detail what I'm
doing. I'm sending this request from a C++ application as follows.

pIXMLHTTPReques t.CreateInstanc e("Msxml2.XMLHT TP.3.0");
pIXMLHTTPReques t->open(_bstr_t(L "POST"), bstrurl, false);
pIXMLHTTPReques t->setRequestHead er("Content-Type", "applicatio n/x-www-
form-urlencoded");
pIXMLHTTPReques t->send("t=1+2+3" );

I'm testing by writing to file on the server

fnameLicense.Wr ite(Request("t" ))

The file content is
1 2 3

I have examined what's being sent to the server using an ethernet
sniffer on the server and I can see t=1+2+3 in one of the packets
received. Anyone know what I'm missing?
Jul 5 '07 #4

<fe*********@ho tmail.comwrote in message
news:11******** **************@ q69g2000hsb.goo glegroups.com.. .
On Jul 4, 9:32 pm, "Bob Barrows [MVP]" <reb01...@NOyah oo.SPAMcom>
wrote:
fergally...@hot mail.com wrote:
I'm sending some data in a HTTP POST to an asp page. The data contains
some + characters. When I try to access the data using
Request.Form("d ata") I get the data but the + characters are replaced
by spaces.
Please post a simple page that reproduces the symptoms you are
experiencing.
"+" characters should not be replaced.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Thanks for you help. I tried that example and I see now that they
should not be replaced. I better explain in more detail what I'm
doing. I'm sending this request from a C++ application as follows.

pIXMLHTTPReques t.CreateInstanc e("Msxml2.XMLHT TP.3.0");
pIXMLHTTPReques t->open(_bstr_t(L "POST"), bstrurl, false);
pIXMLHTTPReques t->setRequestHead er("Content-Type", "applicatio n/x-www-
form-urlencoded");
pIXMLHTTPReques t->send("t=1+2+3" );

I'm testing by writing to file on the server

fnameLicense.Wr ite(Request("t" ))

The file content is
1 2 3

I have examined what's being sent to the server using an ethernet
sniffer on the server and I can see t=1+2+3 in one of the packets
received. Anyone know what I'm missing?
The + is using in URL encoding to encode a space.

Use %2B instead of +

"t=1%2B2%2B 3"

Jul 5 '07 #5
On Jul 5, 11:04 am, "Anthony Jones" <A...@yadayaday ada.comwrote:
<fergally...@ho tmail.comwrote in message

news:11******** **************@ q69g2000hsb.goo glegroups.com.. .


On Jul 4, 9:32 pm, "Bob Barrows [MVP]" <reb01...@NOyah oo.SPAMcom>
wrote:
fergally...@hot mail.com wrote:
I'm sending some data in a HTTP POST to an asp page. The data contains
some + characters. When I try to access the data using
Request.Form("d ata") I get the data but the + characters are replaced
by spaces.
Please post a simple page that reproduces the symptoms you are
experiencing.
"+" characters should not be replaced.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Thanks for you help. I tried that example and I see now that they
should not be replaced. I better explain in more detail what I'm
doing. I'm sending this request from a C++ application as follows.
pIXMLHTTPReques t.CreateInstanc e("Msxml2.XMLHT TP.3.0");
pIXMLHTTPReques t->open(_bstr_t(L "POST"), bstrurl, false);
pIXMLHTTPReques t->setRequestHead er("Content-Type", "applicatio n/x-www-
form-urlencoded");
pIXMLHTTPReques t->send("t=1+2+3" );
I'm testing by writing to file on the server
fnameLicense.Wr ite(Request("t" ))
The file content is
1 2 3
I have examined what's being sent to the server using an ethernet
sniffer on the server and I can see t=1+2+3 in one of the packets
received. Anyone know what I'm missing?

The + is using in URL encoding to encode a space.

Use %2B instead of +

"t=1%2B2%2B 3"- Hide quoted text -

- Show quoted text -
Thanks. That works for the example but the trouble is that I won't be
sending t=1%2B2%2B3 all the time. That was just an example. I'll be
sending something that is read from a file and I don't know whether or
not it contains any + chars.

I guess I could parse the string before hand and replace all
occurances of + with %2B but is there any other way?

Jul 5 '07 #6

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

Similar topics

5
1824
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run into problems. Sending code: ASCIIEncoding encoding = new ASCIIEncoding(); string lcUrl = "http://localhost/test/receive.aspx"; HttpWebRequest loHttp =
0
1345
by: Danny | last post by:
I am working on a project in which a number of client applications will be posting xml documents as a byte array to an ASP.NET page on our web server. I am trying to simulate the process and run into problems. Sending code: ASCIIEncoding encoding = new ASCIIEncoding(); string lcUrl = "http://localhost/test/receive.aspx"; HttpWebRequest loHttp =
8
3868
by: nospam | last post by:
I have an piece of software that is sending an HTTP POST request to an ASP.Net page. The data posted consists of a chunk of XML data. For some reason (Based on my net research, and my tests at least) .Net does not like getting XML data as HTTP POST. If I call Request.SaveAs(...) to save a copy of the request to examine, it doesn't match the request sent (verified my monitoring network traffic). I suspect some filtering is occurring...
1
1613
by: Piotrekk | last post by:
Hi. I receive XMLcontent codded in ISO-8859-1. XML file contains Polish character set so that i need to notice somehow when they are coming. My program cuts this characters and replaces them with "". I have english copy of windows. What am i dooing wrong here. Any help would be appreciated Thanks
5
11663
by: Just D | last post by:
All, Any valuable idea about subj: "The '%' character, hexadecimal value 0x25" ? I tried to google, but nothing interesting was found. Is it IIS settings problem, user side problem or whatever? We receive it regularly and I guess the problem is not in our source codes. Please help! Just D.
1
2681
by: Subrato | last post by:
Hi, I am very new to xml and I have this piece of code which I took off a website. The situation is that on of the website, user files up a form and it is submitted. On submission, the page should do a xml post to my site. On receiving the xml on my end, I take that data and insert it into sql server table. I dont know whats missing . Here is the piece of code I use for my testing. 'Sending
0
1230
by: therig | last post by:
I'm using the following code to send a welcome letter to a user after they've registered with their username/password. Everything seems to work, but when I test the registration with my squirrelmail accounts and comcast account, I don't receive the email, Gmail & some other accounts work fine. Any help would be greatly appreciated. Thanks in advance. Lee <% errorMsg=""
1
2434
by: stepby | last post by:
Hi All, I have use the ajax with the server side language ASP. I find the when passing the parameter with the chinese character, the chinese character cannot show orderly and become "wrong code" . Anyone encounter this problem ? For the javascript coding function createRequest() {
3
3534
by: Tarik Monem | last post by:
Hi Everyone, Still a newbie with FLEX, and I've passed arrays using AJAX to FLEX before, but I've never passed links to FLEX. Basically, this is the OUTPUT, which I wanted, but I'm given an error of "illegal character," from the JavaScript console: Error: illegal character Source Code:
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10319
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
10303
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
9132
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
7608
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
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
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.