VuGen's JSON changing content

3.2k views Asked by At

I'm usinf VuGen for recording performance tests. I have to call some REST api to get JSON which is containing link to resource. My code looks like this:

    web_reg_save_param_ex("ParamName=DownloadLink", "LB=downloadOriginal\":[{\"href\":\"", "RB=\"","Ordinal=ALL", LAST);
    web_custom_request("getAsset",
        "URL=SomeURL",
        "Method=GET",
        "Resource=0",
        "RecContentType=application/json",
        "EncType=application/json; charset=utf-8",
        "Mode=HTML", LAST);

It is working, but part of the link is altered. This part should look like this:

%3A11%3A57.8192731%2B00%3A00

But looks like this:

0X1.F10A00P+559370X1.464180P+44409.5112390B000X1.32F830P+44400

This links has many differences because they are generated dynamically and I counldn't get the same ones for example purposes. It looks like first "%3" is changed to "0X1.F10".

I don't know what type of encoding is this. Does anybody know how decode this link or stop whole encoding?

1

There are 1 answers

0
Michael Galos On

It should specify the encoding type in the response headers.

Try capturing the entire response using this: web_reg_save_param_ex("ParamName=ResponseData", "LB=", "RB=", LAST);

Then lr_message(lr_eval_string("{ResponseData}")); to output the response data so you can see it in it's entirety. See if the encoding is different for all of the response or just the content. Look at the 'Content-Type'.

I also suggest adding a web_add_header("Content-type", "application/json; charset=utf-8"); at the beginning to ensure it sends with the correct encoding.