How to test REST API using LR?

How to test REST API using LR?
 

I would like to use LoadRunner to test REST API 

Could anyone please share your experiences and give me some advices?

i tried  Load testing of a REST API, using HP LoadRunner’s(HTTP/HTML protocal) web_custom_request( ) method but i got XSD_VALIDATION_FAIl , please advice me?

Please find the below code for your reference.


        web_custom_request("Add yms-appointment", 
        "URL=http://192.168.68.242:2019/ywc-1.0/services/yms/appointment", 

       
          "Method=POST", 
        "Resource=0", 
        "EncType=application/xml", 
        "Mode=HTTP",
        "BodyFilePath=sample.xml",
        LAST);
    
    
    

 

Thanks,

Sivanjan BV

  • Hi, 

    Maybe you need to set up the headers or to review the body. This is my example :

        web_add_header("Content-Type", "application/json");
          web_add_header("X-ClientKey", "XXXXXX"); //In case it is necessary
        web_add_header("x-TransactionID", "XXXXXXX"); //In case it is necessary

       
        web_custom_request("Login request",
            "URL=https://XXXXXXXXXXX/login",
            "Method=POST",
            "Resource=0",
            "Referer=",
            "Mode=HTTP",
            "Body={JSON}",
            LAST);

     

    Regards