More HTTPRequest Help Needed

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
fladave
Junior Coder
Posts: 23
Joined: Wed Oct 26, 2011 1:51 pm

More HTTPRequest Help Needed

Post by fladave » Tue Apr 03, 2012 9:10 pm

I am using HTTPRequest to add records to a database. It appears some of the text I am sending is interpreted as HEX values not text.

Below are examples -

I am sending ta%20%Center%20%Blvd I get ta ÃŽnter Blvd instead. The ÃŽ character appears to be a Hex CE.

The %20% represents a space for the syntax for the database API.

I sent ta Center Blvd I got taCenterBlvd

I sent ta%20%Inter%20%Blvd I got ta Inter Blvd

I sent %20%she%20%was%20%very%20%approachable,%20%call%20%her%20%in%20%a%20%few. I get - she was very approachable, Êll her in a þw.

The errors are all preceded by a space.

I am sending )%20%371-3732 I get ) 71-3732. I find if I eliminate the space between ) and 3 I get )371-3732

Thanks again.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Apr 04, 2012 11:03 am

The escape sequence for Space is just %20. I think you are adding an extra % after it, which is wrong. That extra % would then become an escape sequdnce for %CE which as you notice is probably something else.

If you DO intend to send a % symbol as a % symbol then that would need escaping too, since it is an escape char itself. The escape sequence for % is %25 as per the following page:

See:
http://www.december.com/html/spec/esccodes.html

So basically I think your mistake is just that you are using %20% for space instead of just %20 which is correct.

HOWEVER, to make your life a little easier, VBScript has an Escape function which will do all this for you. E.g.

Let>parms=ta Center Blvd
VBEval>Escape("%parms%"),escaped_parms
MessageModal>escaped_parms

You will see that escaped_parms is now a correctly URL escaped string.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

fladave
Junior Coder
Posts: 23
Joined: Wed Oct 26, 2011 1:51 pm

Thank You

Post by fladave » Wed Apr 04, 2012 5:07 pm

That was the answer. Dooohhhh!

BTW, I am using RegEx to replace spaces with %20. Very powerful. I am no longer a RegEx virgin.

Thanks for the great support.

User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Hello

Post by PepsiHog » Fri Apr 06, 2012 7:03 am

RegEx ROCKS!!! Yeah man!!!

I use it like crazy now.

Pointless post, sorry.
PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts