Example request
GET https://postman-echo.com/get?city={{City}}&ramen={{Ramen}}
For this example, we are borrowing a simple request from Qodex Echo. This is Qodex's service to test and demonstrate sample API calls from your REST clients.
This endpoint echoes the HTTP headers, request parameters, and the complete URI requested. We will be sending 2 parameters with our request: city
and ramen
. The parameter data will be supplied in the data file that we will upload when using the Qodex Collection Runner to run the collection.
Under the Tests tab, write your tests in JavaScript. The example test shown here relies on Qodex's pm.*
API. See more examples under the Tests tab in the Qodex app.
pm.test("Body contains City", function () {
pm.expect(pm.response.text()).to.include(pm.iterationData.get("City"));
// older syntax still works too: with dot or bracket notation
pm.expect(pm.response.text()).to.include(data.City);
console.log("City to be sent: " + data["City"]);
});
Request Params
Key | Datatype | Required | Description |
---|---|---|---|
city | string | ||
ramen | string |
RESPONSES
status: OK
{"args":{"city":"{{City}}","ramen":"{{Ramen}}"},"headers":{"host":"postman-echo.com","accept":"*/*","accept-encoding":"gzip, deflate","cache-control":"no-cache","cookie":"sails.sid=s%3AAltJ5Ew2w99uJjH9vfQ62TgIOuEmXFTY.jObB3DswbyhRWU566tKnQL5HoNninxDqzhkgCpb%2FcsU","postman-token":"7c423993-887a-42db-aa70-ef6f16c631a7","user-agent":"PostmanRuntime/7.1.1","x-forwarded-port":"443","x-forwarded-proto":"https"},"url":"https://postman-echo.com/get?city=%7B%7BCity%7D%7D\u0026ramen=%7B%7BRamen%7D%7D"}