Difference between revisions of "Body Data Contains Parameter Delimiter"
Jump to navigation
Jump to search
PeterHarding (talk | contribs) (Created page with "=Overview= Somtimes HTML body contains data which uses the LoadRunner parameter delimiters '{' and '}'. Rendering this in web calls will break the parameter substitution. O...") |
PeterHarding (talk | contribs) |
||
Line 6: | Line 6: | ||
<pre> | <pre> | ||
char body[128]; | |||
sprintf(body, "{Location: \"%f,%f\" }", location.latitude, location.longitude); | |||
lr_save_string(body, "Body"); | |||
web_custom_request("SetCurrentLocation", | |||
"URL=https://{Host}/{Application}/Application/SetCurrentLocation", | "URL=https://{Host}/{Application}/Application/SetCurrentLocation", | ||
"Method=POST", | "Method=POST", |
Revision as of 17:24, 24 September 2014
Overview
Somtimes HTML body contains data which uses the LoadRunner parameter delimiters '{' and '}'. Rendering this in web calls will break the parameter substitution. One way to avoid this is to use an alternative pair of delimiter characters - for example, to something like '[' and ']', provided the HTML data does not contain these.
Where this occurs in only a small number of HTML pages it may be simpler to do something like this:
char body[128]; sprintf(body, "{Location: \"%f,%f\" }", location.latitude, location.longitude); lr_save_string(body, "Body"); web_custom_request("SetCurrentLocation", "URL=https://{Host}/{Application}/Application/SetCurrentLocation", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=https://{Host}/{Application}/Application", "Snapshot=t16.inf", "Mode=HTML", "EncType=application/json", "Body={Body}", LAST);