Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Loadrunner interface test-send a request in JSON format

Shulou Source: shulou.com Published: 2022-06-03 05:44:01 11月24日 Update

Yesterday received a test interface task, the interface request parameters and return results are JSON strings, the first use of the function web_submit_date, the implementation of the Times error, query information did not find the reason, I do not know if the function does not support JSON string, interested can try. Then try using the web_custom_request function, and the results returned after execution are all correct, ok, that's it.

The name shown in the tree view of web_custom_request ("refund", / / VuGen) is "Url= http://***.test.****.com/****/****.php", / / request url" Method=POST ", / / request method" Mode=HTTP "," EncType=application/json " / / specify the Content-Type of the response header Here is JSON "RecContentType=application/json", / / specify the Content-Type of the request header, and here is JSON "Body= {\" source\ ":\" 200\ ",\" RefundType\ ":\" 2\ ",\" TicketNo\ ":\" 547645638233\ ",\" sign\ ":\" d7c7946ce64ad572ff49c0ef2f3f6926\ "}", / / content LAST of body)

Note: 1. If there is a double quotation mark "" in body, escape with backslash "\".

2. Specify the Content-Type of request header and response header as "application/json" in the parameters.

The returned result can be seen in the running log. The content after DECODED response body for is the result returned by the server (under the log option of Vuser-Runtime-settings, check Enable-logging, Extended log, Data returned by server).

Tags: Result function interface content parameter test middle finger task interest reason name place character string that is quotation marks slash mode log Times Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux Shulou Technology Microsoft Shulou Information