Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class
729 views

LR 12.01, REST (json) API Query

Hi,

 

I am recording a REST API Web application using normal HTTP protocol. After I record I can see web_custom_requests recorded in code. (I do not want to use TruClient protocol as the memory footprint is really high)

 

When I go to the snapshot view I can see a response received for the recording. But on replay I don't get any response back for some requests.  

 

Any ideas?

 

Sample recorded code:

 

1) For the below request I can see a response returned & able to capture is.

 

    web_reg_save_param_ex("ParamName=InstrRef", "LB=CD", "RB=", "Ordinal=1", LAST );

 

    web_custom_request("deposit", 
        "URL=https://{URL}/xyz/api/rest/cash/member/deposit", 
        "Method=POST", 
        "TargetFrame=", 
        "Resource=0", 
        "RecContentType=text/html", 
        "Referer=https://{PP_URL}/xyz/pages/cashDepositSa.jsp", 
        "Snapshot=t52.inf", 
        "Mode=HTML", 
        "EncType=application/json", 
        "Body={\"mnemonic\":\"{Mnemonic}\",\"transferType\":\"{TType}\",\"bic\":null,\"valueDate\":\"{TodaysDate}\",\"currency\":\"{Currency}\",\"components\":[{\"subAccount\":\"{SubAcc}\",\"amount\":\"{Amount}\"}],\"uuid\":\"{StrUUID}\"}", 
        LAST);

 

 

2) For the below I can't see any response returned.(I also tried giving empty LB & RB but nothing is returned)

 

   web_reg_save_param_ex("ParamName=LUD", "LB=lastUpdated\":[", "RB=]", "Ordinal=1", LAST );

    web_custom_request("CD3159400", 
        "URL=https://{URL}/xyz/api/rest/cash/cashInstruction/member/detail/CD3159400?_=1416921568326", 
        "Method=GET", 
        "TargetFrame=", 
        "Resource=1", 
        "RecContentType=application/json", 
        "Referer=https://{URL}/xyz/?le=SA", 
        "Snapshot=t45.inf", 
        "EncType=application/json", 
        LAST);  

0 Likes
2 Replies
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

try using blank LB and RB to get the response in your parameter and display it in replay log.

 

web_reg_save_param_ex("ParamName=LUD", "LB=", "RB=",  LAST );

 

0 Likes
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

I did try that (as mentioned above) as well.

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.