0

Within Codeceptjs I'm running an API test using I.sendGetRequest method.

await I.sendGetRequest('api/search');

However I need to be able to pass in parameters in order to have a good request 200 status otherwise all I get is a bad request 400.

These filter options are in a json format that have been URI encoded.

The "sendGetRequest" currently only accepts: url: *, headers?: Object

I need it to accept the following: url: *, payload?: * ,headers?: Object

Does anyone know of a way that the codeceptjs "I.sendGetRequest()" would allow parameters to be pass along with it.

Daniel
  • 45
  • 6

1 Answers1

1

Figured out what I was doing wrong I just needed to pass the parameter string with the URL.

await I.sendGetRequest('api/search' + jsonstring, {"x-session-id": ".........."});

This solved my problem.

Daniel
  • 45
  • 6