Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xmlhttp spaces in url string

Status
Not open for further replies.

mgreer

Programmer
Jan 9, 2001
45
0
0
US
I'm tring to post a normal url string to an asp page but am having trouble with values with spaces in them. For example:

objXMLHTTP.open "POST", mvarURL, False
objXMLHTTP.setRequestHeader "Content-Type", "application/x-
strSend = "field1=string1&field2=string 2"

objXMLHTTP.Send (strSend)


The asp page receiving the string expects the spaces but they are not there. Any suggestions?
 
Try to replace every space with a plus (+).
/JOlesen
 
Another option is to use the Server.URLEncode() method which will encode th entire string for you including all special characters, spaces, etc
-Tarwn "The problem with a kludge is eventually you're going to have to back and do it right." - Programmers Saying (The Wiz Biz - Rick Cook)
"Your a geek!" - My Girlfriends saying
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top