Difference between revisions of "Body Data Contains Parameter Delimiter"

From PeformIQ Upgrade
Jump to navigation Jump to search
(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...")
 
Line 6: Line 6:


<pre>
<pre>
char body[128];
char body[128];


sprintf(body, "{Location: \"%f,%f\" }", location.latitude, location.longitude);
sprintf(body, "{Location: \"%f,%f\" }", location.latitude, location.longitude);
      
      
        lr_save_string(body, "Body");
lr_save_string(body, "Body");
      
      
web_custom_request("SetCurrentLocation",  
web_custom_request("SetCurrentLocation",  
"URL=https://{Host}/{Application}/Application/SetCurrentLocation",  
"URL=https://{Host}/{Application}/Application/SetCurrentLocation",  
"Method=POST",  
"Method=POST",  

Revision as of 16: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);