Here is the flow,
I request a URL, get a JSON return, "requestId":"abc\\nabc"
Then I use this to catch it.
web_reg_save_param_regexp("ParamName=requestId","RegExp=\"requestId\":\"(.*?)\"", SEARCH_FILTERS,"Scope=Body", LAST);
In replay log, Notify: Saving Parameter "requestId = abc\nabc"
finally, submit the form
web_submit_data("statusPoll", "Action=http://someurl/pages/statusPoll", "Method=POST", "RecContentType=application/json", "Referer=http://someurl/pages/vehicle_status.jsp", "Snapshot=t24.inf", "Mode=HTML","EncType=", ITEMDATA, "Name=requestId", "Value={requestId}", ENDITEM, LAST);
In the detail log:
tor.c(93): t=132597ms: 168-byte request body for "http://someurl/pages/statusPoll" (RelFrameId=1, Internal ID=97)
tor.c(93): requestId=abc%5Cnabc
-------------------------- issue ------------------------
loadrunner did not url encode the \n newline to %0A as expected, actually loadrunner url encode \ to %5C ; n to n.
So, how can I got %0a in POST form?
and I try to use web_convert_param("requestId", "SourceEncoding=PLAIN", "TargetEncoding=URL", LAST ); It turned out some story.
Thank you!