UNPKG

api-flow

Version:

A flow written in ES6 using Immutable to convert between API description formats (Swagger, etc.) and other programs such as cURL command lines.

1,416 lines 67.7 kB
{ "variables": [], "info": { "name": "Postman Echo", "_postman_id": "a574f7d2-dd4b-b2f8-fc35-67745fde2035", "description": "Postman Echo is service you can use to test your REST clients and make sample API calls. It provides endpoints for `GET`, `POST`, `PUT`, various auth mechanisms and other utility endpoints.\n\nThe documentation for the endpoints as well as example responses can be found at [https://echo.getpostman.com](https://echo.getpostman.com?source=echo-collection-app-onboarding)", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ { "name": "Auth: Digest", "description": "Digest authentication protects an endpoint with a username and password without actually transmitting the password over network.\nOne has to apply a hash function (like MD5, etc) to the username and password before sending them over the network.\n\n> Username: `postman`\n>\n> Password: `password`\n\nUnlike Basic-Auth, authentication happens using two consecutive requests where the first request returns `401 Unauthorised` along with `WWW-Authenticate` header containing information that needs to be used to authenticate subsequent calls.\n\nTo know more about digest authentication, refer to the [Digest Access Authentication](https://en.wikipedia.org/wiki/Digest_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#digest-auth) elaborates how to use the same within the Postman app.", "item": [ { "name": "DigestAuth Request", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "tests[\"response code is 401\"] = responseCode.code === 401;\ntests[\"response has WWW-Authenticate header\"] = (postman.getResponseHeader('WWW-Authenticate'));\n\nvar authenticateHeader = postman.getResponseHeader('WWW-Authenticate'),\n realmStart = authenticateHeader.indexOf('\"',authenticateHeader.indexOf(\"realm\")) + 1 ,\n realmEnd = authenticateHeader.indexOf('\"',realmStart),\n realm = authenticateHeader.slice(realmStart,realmEnd),\n nonceStart = authenticateHeader.indexOf('\"',authenticateHeader.indexOf(\"nonce\")) + 1,\n nonceEnd = authenticateHeader.indexOf('\"',nonceStart),\n nonce = authenticateHeader.slice(nonceStart,nonceEnd);\n \npostman.setGlobalVariable('echo_digest_realm', realm);\npostman.setGlobalVariable('echo_digest_nonce', nonce);" } } ], "request": { "url": "https://echo.getpostman.com/digest-auth", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "code", "value": "xWnkliVQJURqB2x1", "type": "text", "enabled": true }, { "key": "grant_type", "value": "authorization_code", "type": "text", "enabled": true }, { "key": "redirect_uri", "value": "https://www.getpostman.com/oauth2/callback", "type": "text", "enabled": true }, { "key": "client_id", "value": "abc123", "type": "text", "enabled": true }, { "key": "client_secret", "value": "ssh-secret", "type": "text", "enabled": true } ] }, "description": "Performing a simple `GET` request to this endpoint returns status code `401 Unauthorized` with `WWW-Authenticate` header containing information to successfully authenticate subsequent requests.\nThe `WWW-Authenticate` header must be processed to extract `realm` and `nonce` values to hash subsequent requests.\n\nWhen this request is executed within Postman, the script attached with this request does the hard work of extracting realm and nonce from the header and set it as [global variables](https://www.getpostman.com/docs/environments#global-variables?source=echo-collection-app-onboarding) named `echo_digest_nonce` and `echo_digest_realm`.\nThese variables are re-used in subsequent request for seamless integration of the two requests." }, "response": [] }, { "name": "DigestAuth Success", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "tests[\"response code is 200\"] = responseCode.code === 200;\ntests[\"body contains authenticated\"] = responseBody.has(\"authenticated\");" } } ], "request": { "auth": { "type": "digest", "digest": { "algorithm": "MD5", "username": "postman", "realm": "{{echo_digest_realm}}", "password": "password", "nonce": "{{echo_digest_nonce}}", "nonceCount": "", "clientNonce": "", "opaque": "", "qop": "" } }, "url": "https://echo.getpostman.com/digest-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Digest username=\"postman\", realm=\"Users\", nonce=\"ni1LiL0O37PRRhofWdCLmwFsnEtH1lew\", uri=\"/digest-auth\", response=\"254679099562cf07df9b6f5d8d15db44\", opaque=\"\"", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint sends a hashed Digest Authorization header to gain access to a valid `200 Ok` response code. In Postman, it uses the stored [global variables](https://www.getpostman.com/docs/environments#gloval-variables?source=echo-collection-app-onboarding), `echo_digest_realm` and `echo_digest_nonce`, to generate the hashed authorisation header.\n\nWithin Postman, for this request to successfully authenticate, running the previous request \"DigestAuth Request\" stores the relevant information within the global variables." }, "response": [ { "name": "200", "originalRequest": { "auth": { "type": "digest", "digest": { "algorithm": "MD5", "username": "postman", "realm": "{{echo_digest_realm}}", "password": "password", "nonce": "{{echo_digest_nonce}}", "nonceCount": "", "clientNonce": "", "opaque": "", "qop": "" } }, "url": "https://echo.getpostman.com/digest-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Digest username=\"postman\", realm=\"Users\", nonce=\"ni1LiL0O37PRRhofWdCLmwFsnEtH1lew\", uri=\"/digest-auth\", response=\"254679099562cf07df9b6f5d8d15db44\", opaque=\"\"", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint sends a hashed Digest Authorization header to gain access to a valid `200 Ok` response code. In Postman, it uses the stored [global variables](https://www.getpostman.com/docs/environments#gloval-variables?source=echo-collection-app-onboarding), `echo_digest_realm` and `echo_digest_nonce`, to generate the hashed authorisation header.\n\nWithin Postman, for this request to successfully authenticate, running the previous request \"DigestAuth Request\" stores the relevant information within the global variables." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "42", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Thu, 29 Oct 2015 06:17:51 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "9843", "body": "{\"authenticated\":true}" }, { "name": "200", "originalRequest": { "auth": { "type": "digest", "digest": { "algorithm": "MD5", "username": "postman", "realm": "{{echo_digest_realm}}", "password": "password", "nonce": "{{echo_digest_nonce}}", "nonceCount": "", "clientNonce": "", "opaque": "", "qop": "" } }, "url": "https://echo.getpostman.com/digest-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Digest username=\"postman\", realm=\"Users\", nonce=\"ni1LiL0O37PRRhofWdCLmwFsnEtH1lew\", uri=\"/digest-auth\", response=\"254679099562cf07df9b6f5d8d15db44\", opaque=\"\"", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint sends a hashed Digest Authorization header to gain access to a valid `200 Ok` response code. In Postman, it uses the stored [global variables](https://www.getpostman.com/docs/environments#gloval-variables?source=echo-collection-app-onboarding), `echo_digest_realm` and `echo_digest_nonce`, to generate the hashed authorisation header.\n\nWithin Postman, for this request to successfully authenticate, running the previous request \"DigestAuth Request\" stores the relevant information within the global variables." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "42", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Thu, 29 Oct 2015 06:17:51 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "9843", "body": "{\"authenticated\":true}" } ] } ] }, { "name": "Auth: Others", "description": "", "item": [ { "name": "Basic Auth", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "tests[\"response code is 200\"] = responseCode.code === 200;\ntests[\"Body contains authenticated\"] = responseBody.has(\"authenticated\");" } } ], "request": { "auth": { "type": "basic", "basic": { "username": "postman", "password": "password", "saveHelperData": true, "showPassword": false } }, "url": "https://echo.getpostman.com/basic-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Basic cG9zdG1hbjpwYXNzd29yZA==", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint simulates a **basic-auth** protected endpoint. \nThe endpoint accepts a default username and password and returns a status code of `200 ok` only if the same is provided. \nOtherwise it will return a status code `401 unauthorized`.\n\n> Username: `postman`\n> \n> Password: `password`\n\nTo use this endpoint, send a request with the header `Authorization: Basic cG9zdG1hbjpwYXNzd29yZA==`. \nThe cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. \nUsing Postman, to send this request, you can simply fill in the username and password in the \"Authorization\" tab and Postman will do the rest for you.\n\nTo know more about basic authentication, refer to the [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#basic-auth?source=echo-collection-app-onboarding) elaborates how to use the same within the Postman app." }, "response": [ { "name": "401", "originalRequest": { "auth": { "type": "basic", "basic": { "username": "postman", "password": "password", "saveHelperData": true, "showPassword": false } }, "url": "https://echo.getpostman.com/basic-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Basic cG9zdG1hbjpwYXNzd29yZA==", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint simulates a **basic-auth** protected endpoint. \nThe endpoint accepts a default username and password and returns a status code of `200 ok` only if the same is provided. \nOtherwise it will return a status code `401 unauthorized`.\n\n> Username: `postman`\n> \n> Password: `password`\n\nTo use this endpoint, send a request with the header `Authorization: Basic cG9zdG1hbjpwYXNzd29yZA==`. \nThe cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. \nUsing Postman, to send this request, you can simply fill in the username and password in the \"Authorization\" tab and Postman will do the rest for you.\n\nTo know more about basic authentication, refer to the [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#basic-auth?source=echo-collection-app-onboarding) elaborates how to use the same within the Postman app." }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "html", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Date", "key": "Date", "value": "Sat, 31 Oct 2015 06:38:51 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "WWW-Authenticate", "key": "WWW-Authenticate", "value": "Basic realm=\"Users\"", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" }, { "name": "transfer-encoding", "key": "transfer-encoding", "value": "chunked", "description": "" } ], "cookie": [], "responseTime": "276", "body": "Unauthorized" }, { "name": "200", "originalRequest": { "auth": { "type": "basic", "basic": { "username": "postman", "password": "password", "saveHelperData": true, "showPassword": false } }, "url": "https://echo.getpostman.com/basic-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Basic cG9zdG1hbjpwYXNzd29yZA==", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint simulates a **basic-auth** protected endpoint. \nThe endpoint accepts a default username and password and returns a status code of `200 ok` only if the same is provided. \nOtherwise it will return a status code `401 unauthorized`.\n\n> Username: `postman`\n> \n> Password: `password`\n\nTo use this endpoint, send a request with the header `Authorization: Basic cG9zdG1hbjpwYXNzd29yZA==`. \nThe cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. \nUsing Postman, to send this request, you can simply fill in the username and password in the \"Authorization\" tab and Postman will do the rest for you.\n\nTo know more about basic authentication, refer to the [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#basic-auth?source=echo-collection-app-onboarding) elaborates how to use the same within the Postman app." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "42", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Sat, 31 Oct 2015 06:38:25 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "377", "body": "{\"authenticated\":true}" } ] }, { "name": "OAuth1.0 Verify Signature", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "tests[\"response code is 200\"] = responseCode.code === 200;\nvar body = JSON.parse(responseBody);\ntests[\"Body contains status pass\"] = body[\"status\"] == \"pass\"" } } ], "request": { "url": "https://echo.getpostman.com/oauth1", "method": "GET", "header": [ { "key": "Authorization", "value": "OAuth oauth_consumer_key=\"RKCGzna7bv9YD57c\",oauth_signature_method=\"HMAC-SHA1\",oauth_timestamp=\"1442394747\",oauth_nonce=\"UIGipk\",oauth_version=\"1.0\",oauth_signature=\"CaeyGPr2mns1WCq4Cpm5aLvz6Gs=\"", "description": "" } ], "body": { "mode": "formdata", "formdata": [ { "key": "code", "value": "xWnkliVQJURqB2x1", "type": "text", "enabled": true }, { "key": "grant_type", "value": "authorization_code", "type": "text", "enabled": true }, { "key": "redirect_uri", "value": "https://www.getpostman.com/oauth2/callback", "type": "text", "enabled": true }, { "key": "client_id", "value": "abc123", "type": "text", "enabled": true }, { "key": "client_secret", "value": "ssh-secret", "type": "text", "enabled": true } ] }, "description": "OAuth1.0a is a specification that defines a protocol that can be used by one\nservice to access \"protected\" resources (endpoints) on another service. A\nmajor part of OAuth1.0 is HTTP Request Signing. This endpoint allows you to \ncheck whether the request calculation works properly in the client. \n\nThe endpoint supports the HTTP ``Authorization`` header. In case the signature\nverification fails, the endpoint provides the four debug values,\n\n* ``base_uri``\n* ``normalized_param_string``\n* ``base_string``\n* ``signing_key``\n\nFor more details about these parameters, check the [OAuth1.0a Specification](http://oauth.net/core/1.0a/)\n\nIn order to use this endpoint, you can set the following values:\n\n> Consumer Key: ``RKCGzna7bv9YD57c``\n>\n> Consumer Secret: ``D+EdQ-gs$-%@2Nu7``\n\nIf you are using Postman, also check the \"Add params to header\" and \n\"Auto add parameters\" boxes." }, "response": [] }, { "name": "AWS Sig 4 Auth", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "tests[\"response code is 200\"] = responseCode.code === 200;\ntests[\"Body contains authenticated\"] = responseBody.has(\"authenticated\");" } } ], "request": { "auth": { "type": "awsv4", "awsv4": { "accessKey": "qwdqwdqwd", "secretKey": "asdasdasd", "region": "us-east-1", "service": "zaxax", "saveToRequest": true } }, "url": "https://echo.getpostman.com/basic-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "AWS4-HMAC-SHA256 Credential=qwdqwdqwd/20160915/us-east-1/zaxax/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=e9c77154a6c42e95f381bd8fa03a2479646d8a8c515d246d446064c28c010b0c", "description": "" }, { "key": "Content-Type", "value": "application/x-www-form-urlencoded", "description": "" }, { "key": "Host", "value": "echo.getpostman.com", "description": "" }, { "key": "X-Amz-Date", "value": "20160915T130502Z", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint simulates a **basic-auth** protected endpoint. \nThe endpoint accepts a default username and password and returns a status code of `200 ok` only if the same is provided. \nOtherwise it will return a status code `401 unauthorized`.\n\n> Username: `postman`\n> \n> Password: `password`\n\nTo use this endpoint, send a request with the header `Authorization: Basic cG9zdG1hbjpwYXNzd29yZA==`. \nThe cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. \nUsing Postman, to send this request, you can simply fill in the username and password in the \"Authorization\" tab and Postman will do the rest for you.\n\nTo know more about basic authentication, refer to the [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#basic-auth?source=echo-collection-app-onboarding) elaborates how to use the same within the Postman app." }, "response": [ { "name": "401", "originalRequest": { "auth": { "type": "basic", "basic": { "username": "postman", "password": "password", "saveHelperData": true, "showPassword": false } }, "url": "https://echo.getpostman.com/basic-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Basic cG9zdG1hbjpwYXNzd29yZA==", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint simulates a **basic-auth** protected endpoint. \nThe endpoint accepts a default username and password and returns a status code of `200 ok` only if the same is provided. \nOtherwise it will return a status code `401 unauthorized`.\n\n> Username: `postman`\n> \n> Password: `password`\n\nTo use this endpoint, send a request with the header `Authorization: Basic cG9zdG1hbjpwYXNzd29yZA==`. \nThe cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. \nUsing Postman, to send this request, you can simply fill in the username and password in the \"Authorization\" tab and Postman will do the rest for you.\n\nTo know more about basic authentication, refer to the [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#basic-auth?source=echo-collection-app-onboarding) elaborates how to use the same within the Postman app." }, "status": "Unauthorized", "code": 401, "_postman_previewlanguage": "html", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Date", "key": "Date", "value": "Sat, 31 Oct 2015 06:38:51 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "WWW-Authenticate", "key": "WWW-Authenticate", "value": "Basic realm=\"Users\"", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" }, { "name": "transfer-encoding", "key": "transfer-encoding", "value": "chunked", "description": "" } ], "cookie": [], "responseTime": "276", "body": "Unauthorized" }, { "name": "200", "originalRequest": { "auth": { "type": "basic", "basic": { "username": "postman", "password": "password", "saveHelperData": true, "showPassword": false } }, "url": "https://echo.getpostman.com/basic-auth", "method": "GET", "header": [ { "key": "Authorization", "value": "Basic cG9zdG1hbjpwYXNzd29yZA==", "description": "" } ], "body": { "mode": "formdata", "formdata": [] }, "description": "This endpoint simulates a **basic-auth** protected endpoint. \nThe endpoint accepts a default username and password and returns a status code of `200 ok` only if the same is provided. \nOtherwise it will return a status code `401 unauthorized`.\n\n> Username: `postman`\n> \n> Password: `password`\n\nTo use this endpoint, send a request with the header `Authorization: Basic cG9zdG1hbjpwYXNzd29yZA==`. \nThe cryptic latter half of the header value is a base64 encoded concatenation of the default username and password. \nUsing Postman, to send this request, you can simply fill in the username and password in the \"Authorization\" tab and Postman will do the rest for you.\n\nTo know more about basic authentication, refer to the [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) wikipedia article.\nThe article on [authentication helpers](https://www.getpostman.com/docs/helpers#basic-auth?source=echo-collection-app-onboarding) elaborates how to use the same within the Postman app." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "42", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Sat, 31 Oct 2015 06:38:25 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "377", "body": "{\"authenticated\":true}" } ] } ] }, { "name": "Content-Type: form-data", "description": "", "item": [ { "name": "urlencoded w/ header provided (200)", "request": { "url": "https://echo.getpostman.com/post", "method": "POST", "header": [ { "key": "Content-Type", "value": "application/x-www-form-urlencoded", "description": "" } ], "body": { "mode": "urlencoded", "urlencoded": [ { "key": "type", "value": "file", "type": "text", "enabled": true }, { "key": "data", "value": "Lorem Ipsum", "type": "text", "enabled": true } ] }, "description": "" }, "response": [] }, { "name": "formdata w/ header provided (500)", "request": { "url": "https://echo.getpostman.com/post", "method": "POST", "header": [ { "key": "Content-Type", "value": "multipart/form-data", "description": "" } ], "body": { "mode": "formdata", "formdata": [ { "key": "file", "value": "hellno", "type": "text", "enabled": true }, { "key": "other", "value": "value", "type": "text", "enabled": true } ] }, "description": "" }, "response": [] }, { "name": "urlencoded w/o header provided (200)", "request": { "url": "https://echo.getpostman.com/post", "method": "POST", "header": [], "body": { "mode": "urlencoded", "urlencoded": [ { "key": "type", "value": "file", "type": "text", "enabled": true }, { "key": "data", "value": "Lorem Ipsum", "type": "text", "enabled": true } ] }, "description": "" }, "response": [] }, { "name": "formdata w/o header provided (200)", "request": { "url": "https://echo.getpostman.com/post", "method": "POST", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "file", "value": "hellno", "type": "text", "enabled": true }, { "key": "other", "value": "value", "type": "text", "enabled": true } ] }, "description": "" }, "response": [] } ] }, { "name": "Cookies", "description": "The cookie related endpoints allow one to get, set and delete simple cookies.\n\nCookies are small snippets of information that is stored in the browser and sent back to the server with every subsequent requests in order to store useful information between requests.\nIf you want to know more about cookies, read the [HTTP Cookie](https://en.wikipedia.org/wiki/HTTP_cookie) article on wikipedia.", "item": [ { "name": "Set Cookies", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "var responseJSON;\ntry {\n tests[\"Body contains cookies\"] = responseBody.has(\"cookies\");\n responseJSON = JSON.parse(responseBody);\n tests[\"Body contains cookie foo1\"] = 'foo1' in responseJSON.cookies;\n tests[\"Body contains cookie foo2\"] = 'foo2' in responseJSON.cookies; \n}\ncatch (e) { }\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n\n" } } ], "request": { "url": "https://echo.getpostman.com/cookies/set?foo1=bar1&foo2=bar2", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "description": "The cookie setter endpoint accepts a list of cookies and their values as part of URL parameters of a `GET` request. These cookies are saved and can be subsequently retrieved or deleted. The response of this request returns a JSON with all cookies listed.\n\nTo set your own set of cookies, simply replace the URL parameters \"foo1=bar1&foo2=bar2\" with your own set of key-value pairs." }, "response": [ { "name": "Cookies", "originalRequest": { "url": "https://echo.getpostman.com/cookies/set?foo1=bar1&foo2=bar2", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "description": "The cookie setter endpoint accepts a list of cookies and their values as part of URL parameters of a `GET` request. These cookies are saved and can be subsequently retrieved or deleted. The response of this request returns a JSON with all cookies listed.\n\nTo set your own set of cookies, simply replace the URL parameters \"foo1=bar1&foo2=bar2\" with your own set of key-value pairs." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "51", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Thu, 29 Oct 2015 06:15:28 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "3063", "body": "{\"cookies\":{\"foo1\":\"bar\",\"foo2\":\"bar\"}}" } ] }, { "name": "Delete Cookies", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "var responseJSON;\ntry {\n tests[\"Body contains cookies\"] = responseBody.has(\"cookies\");\n responseJSON = JSON.parse(responseBody);\n tests[\"Body contains cookie foo2\"] = !('foo2' in responseJSON.cookies);\n tests[\"Body does not contain cookie foo2\"] = !('foo1' in responseJSON.cookies);\n}\ncatch (e) { }\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n" } } ], "request": { "url": "https://echo.getpostman.com/cookies/delete?foo1&foo2", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "description": "One or more cookies that has been set for this domain can be deleted by providing the cookie names as part of the URL parameter. The response of this request is a JSON containing the list of currently set cookies." }, "response": [ { "name": "Cookies Response", "originalRequest": { "url": "https://echo.getpostman.com/cookies/delete?foo1&foo2", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "description": "One or more cookies that has been set for this domain can be deleted by providing the cookie names as part of the URL parameter. The response of this request is a JSON containing the list of currently set cookies." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "46", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Thu, 29 Oct 2015 06:16:00 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "1417", "body": "{\"cookies\":{\"foo2\":\"bar\"}}" } ] }, { "name": "Get Cookies", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "var responseJSON;\ntry {\n tests[\"Body contains cookies\"] = responseBody.has(\"cookies\");\n responseJSON = JSON.parse(responseBody);\n tests[\"Cookies object is empty\"] = (Object.keys(responseJSON.cookies).length === 0)\n}\ncatch (e) { }\n\ntests[\"Status code is 200\"] = responseCode.code === 200;\n" } } ], "request": { "url": "https://echo.getpostman.com/cookies", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "description": "Use this endpoint to get a list of all cookies that are stored with respect to this domain. Whatever key-value pairs that has been previously set by calling the \"Set Cookies\" endpoint, will be returned as response JSON." }, "response": [ { "name": "Cookies", "originalRequest": { "url": "https://echo.getpostman.com/cookies", "method": "GET", "header": [], "body": { "mode": "formdata", "formdata": [] }, "description": "Use this endpoint to get a list of all cookies that are stored with respect to this domain. Whatever key-value pairs that has been previously set by calling the \"Set Cookies\" endpoint, will be returned as response JSON." }, "status": "OK", "code": 200, "_postman_previewlanguage": "javascript", "_postman_previewtype": "html", "header": [ { "name": "Access-Control-Allow-Credentials", "key": "Access-Control-Allow-Credentials", "value": "", "description": "" }, { "name": "Access-Control-Allow-Headers", "key": "Access-Control-Allow-Headers", "value": "", "description": "" }, { "name": "Access-Control-Allow-Methods", "key": "Access-Control-Allow-Methods", "value": "", "description": "" }, { "name": "Access-Control-Allow-Origin", "key": "Access-Control-Allow-Origin", "value": "", "description": "" }, { "name": "Connection", "key": "Connection", "value": "keep-alive", "description": "" }, { "name": "Content-Encoding", "key": "Content-Encoding", "value": "gzip", "description": "" }, { "name": "Content-Length", "key": "Content-Length", "value": "46", "description": "" }, { "name": "Content-Type", "key": "Content-Type", "value": "application/json; charset=utf-8", "description": "" }, { "name": "Date", "key": "Date", "value": "Thu, 29 Oct 2015 06:16:29 GMT", "description": "" }, { "name": "Server", "key": "Server", "value": "nginx/1.6.2", "description": "" }, { "name": "Vary", "key": "Vary", "value": "Accept-Encoding", "description": "" }, { "name": "X-Powered-By", "key": "X-Powered-By", "value": "Sails <sailsjs.org>", "description": "" } ], "cookie": [], "responseTime": "462", "body": "{\"cookies\":{\"foo2\":\"bar\"}}" } ] } ] }, { "name": "Headers", "description": "The following set of endpoints allow one to see the headers being sent as part of a request and to get a custom set of headers as part of response.\n\nHTTP header fields provide required information about the request or response, or about the object sent in the message body. Both request headers and response headers can be controlled using these endpoints.", "item": [ { "name": "Request Headers", "event": [ { "listen": "test", "script": { "type": "text/javascript", "exec": "var responseJSON;\ntry {\n tests[\"Body contains headers\"] = responseBody.has(\"headers\");\n responseJSON = JSON.parse(responseBody);\n tests[\"Header contains host\"] = \"host\" in responseJSON.headers;\n tests[\"Header contains test parameter sent as part of request header\"] = \"my-sample-header\" in responseJSON.headers;\n}\ncatch (e) { }\n\n\n\n" } } ], "request": { "url": "https://echo.getpostman.com/he