Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
115 lines (115 sloc) 2.47 KB
{
"info": {
"name": "Echo example",
"_postman_id": "40cf1f4a-9645-4f26-981d-d1d16a07a720",
"description": "A simple API to echo back messages.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "echo",
"description": "Folder for echo",
"item": [
{
"name": "Simple echo",
"event": [
{
"listen": "test",
"script": {
"id": "8ae10e5b-5685-4907-b819-dfeefe475016",
"type": "text/javascript",
"exec": [
"tests[\"Status code is 200\"] = responseCode.code === 200;",
"",
"pm.test(\"Response echo must match\", function () {",
" pm.response.to.be.json; // We must have a JSON body",
" ",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.echo).to.eql(\"example\");",
"});"
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {},
"url": {
"raw": "http://localhost:5000/echo?echo=example",
"protocol": "http",
"host": [
"localhost"
],
"port": "5000",
"path": [
"echo"
],
"query": [
{
"key": "echo",
"value": "example",
"equals": true
}
]
},
"description": "Echo's back the query string param if provided."
},
"response": []
},
{
"name": "Intentional 404",
"event": [
{
"listen": "test",
"script": {
"id": "9fdd83f3-e6fa-45e7-a4c3-f41e65aac9ea",
"type": "text/javascript",
"exec": [
"tests[\"Status code is 404\"] = responseCode.code === 404;",
""
]
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {},
"url": {
"raw": "http://localhost:5000/foo",
"protocol": "http",
"host": [
"localhost"
],
"port": "5000",
"path": [
"foo"
]
},
"description": "Echo's back the query string param if provided."
},
"response": []
}
]
}
]
}