Sunday 30 June 2019

Error 415 unsupported media type load runner | HTTP error code 415 unsupported in Vugen

If you are facing the  415 unsupported media type error in your Vugen scripting check the following things to resolve.

1.check all the headers (including authentication headers) and add if anything is missing.

web_add_header("AccessToken","{Test_Token}");
web_add_header("Authorization","{ABCTokenType} {ABCAccessToken}");
web_add_header("Accept","application/json, text/plain, */*");
web_add_header("Origin", "https://testsite.com");

2.Check with https and http

3.Try to add  "RecContentType=application/soap+xml", or    "RecContentType=application/json",

4.Method should be accurate "Method=POST or PUT or GET"

The code should be like this:

web_custom_request("ABC",
       "URL=https://xyz.com/abc",
       "Method=POST",
       "Snapshot=t67.inf",
       "RecContentType=application/soap+xml",
        "EncType=application/soap+xml; charset=utf-8",

        "Mode=HTML",
        "Body= xml request or Json request or other request", 
         LAST);


Tags:
LR 12.55 - PUT method - Error 415 unsupported media type
415 (Unsupported Media Type) in loadrunner
415 (Unsupported Media Type) in viugen