HTTPRequest - Problem when migrating to V7.3.01

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Staple
Newbie
Posts: 2
Joined: Sun Nov 07, 2004 10:54 am

HTTPRequest - Problem when migrating to V7.3.01

Post by Staple » Sun Nov 07, 2004 11:42 am

Hi folks,

I have noticed a problem with HTTPRequest when using a macro that runs fine under version 7.2.050 but fails with version 7.3.01.

The problem is with the characters %40n. I have copied the line which creates the 'PostData' variable below. I've used x's to cover confidential information.

Let>PostData=xxxxx%5Fxxxxxx=1&xxx%5Fxxxx=1&Telephone=xxxxxxxxxxx&Date%5Fof%5FBirth=xxxxxx&Email=xxxxxxxx%40ntlworld%2Ecom&Name=xxxxxxxxxx

The HTTPRequest line is as follows:

HTTPRequest>http://www.somewebsitexxx.co.uk,,POST,PostData,HTMLResponse

The HTTPRequest command never returns and Macro Scheduler has to be terminated. Stopping the macro is not enough.

The error message that appears is:

No argument for format '%40n'

I've also noticed with HTTPRequest commands that work in other macros Macro Scheduler is 'busy' until the command returns. This is not the case using V7.2.050.

I'm using Windows XP Service Pack 2.

Can support please confirm whether this is a recreatable problem or am I making a mistake in the macro.

Thanks and best regards.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Sun Nov 07, 2004 6:08 pm

Hi,

I don't like that error and will endeavour to get it improved. However, I think the problem is that your request string is already encoded and in fact the httprequest function should do that for you. Try unescaping it first. A quick way to do that is to use VBScript's unescape function:

//put these two lines at top of script so that msched knows to use vbscript
VBSTART
VBEND

//unescape PostData
VBEval>unescape("%PostData%"),PostData

Let us know if it works ok without being escaped.
MJT Net Support
[email protected]

Guest

Post by Guest » Mon Nov 08, 2004 4:46 pm

Thanks for the quick response.

I've tried using the 'unescape' function and Macro Scheduler now works fine.

However the remote is expecting the escape characters and now rejects the POST.

I'm not sure how I'll get around this as I have no control over the remote system.

I think I'll have to stay with V7.2.050 for the time being.

Best regards.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Mon Nov 08, 2004 4:57 pm

That's odd because HTTPRequest escapes the post data anyway, so there is no need to escape it first.

We'll look into it anyway.
MJT Net Support
[email protected]

Staple
Newbie
Posts: 2
Joined: Sun Nov 07, 2004 10:54 am

Post by Staple » Mon Nov 08, 2004 6:06 pm

Hi again,

I've used a sniffer to capture the data. The first example is as submitted from the web page the second is the same string passed through the unescape function and submitted using an HTTPRequest POST.

-----------------------------------------------------------------------------

Example 1

xxxxx%5Fxxxxxx=1&xxx%5Fxxxx=1&Telephone=xxxxxxxxxxx&Date%5Fof%5FBirth=xxxxxx&Email=xxxxx%40ntlworld%2Ecom&Name=xxxx%20xxxxxxx

Example 2


Content-Disposition: form-data; name="xxxxx_xxxxxx"

1

Content-Disposition: form-data; name="xxx_xxxx"

1

Content-Disposition: form-data; name="Telephone"

xxxxxxxxxxx

Content-Disposition: form-data; name="Date_of_Birth"

xxxxxx

Content-Disposition: form-data; name="Email"

[email protected]

Content-Disposition: form-data; name="Name"

xxxxxxxxxxxx



Request format is invalid: multipart/form-data;

-------------------------------------------------------------------------------
So rather than a single string it appears to be submitting a seperate string for each element.

There is also still the issue with Macro Scheduler being 'busy' (don't really know how else to describe it) until the HTTPRequest returns. Again this does not happen with V7.2.050

I should point out that this is not a major issue for me. Nothing vital depends on this but it is a difference between releases that has stopped some macros working.

Hope that helps.

Best regards.

User avatar
transolut
Newbie
Posts: 14
Joined: Wed May 19, 2004 2:00 pm
Location: Des Moines, IA USA

Post by transolut » Wed Mar 30, 2005 8:31 pm

Mike Miller
Transolut

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