RayLoganGop
RayLoganGop

Reputation: 45

JMeter: Body & File content

The WebAPI request has a POST method which expects Content body. I've tried to use both Parameters and Body options but I receive error responses - 'Invalid Request' with 400 Status code, etc.

JMeter request Sample Content Body:

{
    "ParamA": 111,
    "ParamB": "Char String",
    "ParamC": "VarType"
}

OR

{ "ParamA": 111, "ParamB": "Char String", "ParamC": "VarType"}

Listener Request:

Listener Response:

Any insight into viable options? Eventually, I'm planning on reading the Body string from a .csv file so I can parameterize the request. Reading from a .CSV file only reads the first line of the request body - for example: '{'

Any help would be greatly appreciated.

Best, Ray

HTTP Request

Request

Upvotes: 2

Views: 829

Answers (1)

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34556

Uncheck in HTTP request the option:

  • Use multipart/form data for POST

Also check your CSV does not contain some data that contains the CSV separator which is '\t' by default.

Ensure it doesn't by changing separator to '|' for example if you're sure your JSON will never contain it.

Upvotes: 1

Related Questions