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.
HTTPRequest - Problem when migrating to V7.3.01
Moderators: Dorian (MJT support), JRL
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.
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]
[email protected]
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.
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.
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.
We'll look into it anyway.
MJT Net Support
[email protected]
[email protected]
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.
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.