You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 06_api_testing_and_collection_runner/sandbox.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,13 @@ The Postman Sandbox is a JavaScript execution environment that is available to y
3
3
### Commonly used libraries and utilities
4
4
5
5
*[Lodash][0]: JS utility library
6
-
*[jQuery][1] Deprecated: Cross-platform JavaScript library. This will be removed in future versions of the sandbox.
7
-
*[BackboneJS][2] Deprecated: Provides simple models, views, and collections. This will be removed in future versions of the sandbox.
6
+
*[jQuery][1]**Deprecated**: Cross-platform JavaScript library. This will be removed in future versions of the sandbox.
7
+
*[BackboneJS][2]**Deprecated**: Provides simple models, views, and collections. This will be removed in future versions of the sandbox.
8
8
*[SugarJS][3]: Extends native JS objects with useful methods
9
9
*[tv4 JSON schema validator][4]: Validates JSON objects against v4 of the json-schema draft
10
10
*[CryptoJS][5]: standard and secure cryptographic algorithms. Supported algorithms: AES, DES, EvpKDF, HMAC-MD5, HMAC-SHA1/3/256/512, MD5, PBKDF2, Rabbit, SHA1/3/224/256/512, TripleDES
11
11
*`xml2Json(xmlString)`: This function behaves the same in Newman and Postman
12
-
*`xmlToJson(xmlString)` Deprecated: This function does NOT behave the same in Newman and Postman
12
+
*`xmlToJson(xmlString)`**Deprecated**: This function does NOT behave the same in Newman and Postman
13
13
*`postman.getResponseHeader(headerName)` Test-only: returns the response header with name "headerName", if it exists. Returns null if no such header exists.
14
14
Note: According to W3C specifications, header names are case-insensitive.
15
15
This method takes care of this. `postman.getResponseHeader("Content-type")` and `postman.getResponseHeader("content-Type")` will return the same value.
@@ -51,17 +51,17 @@ Note: Variables will NOT be resolved in the request object. The request object i
51
51
*`headers {object}` - this is a dictionary of headers for the request (request.headers\["key"\]=="value")
52
52
*`method {string}` - GET/POST/PUT etc.
53
53
*`url {string}` - the url for the request.
54
-
*`responseHeaders {object}` Test-only Deprecated: This is a map of the response headers. This is case-sensitive, and should not be used. Check the `postman.getResponseHeader()` method listed above.
55
-
*`responseBody {string}` Test-only: A string containing the raw response body text. You can use this as an input to JSON.parse, or xml2Json.
56
-
*`responseTime {number}` Test-only: The response time in milliseconds
57
-
*`responseCode {object}` Test-only: Contains three properties:
54
+
*`responseHeaders {object}`**Deprecated**, **Test-only**: This is a map of the response headers. This is case-sensitive, and should not be used. Check the `postman.getResponseHeader()` method listed above.
55
+
*`responseBody {string}`**Test-only**: A string containing the raw response body text. You can use this as an input to JSON.parse, or xml2Json.
56
+
*`responseTime {number}`**Test-only**: The response time in milliseconds
57
+
*`responseCode {object}`**Test-only**: Contains three properties:
58
58
*`code {number}`: The response code (200 for OK, 404 for Not Found etc)
59
59
*`name {string}`: The status code text
60
60
*`detail {string}`: An explanation of the response code
61
-
*`tests {object}` Test-only: This object is for you to populate. Postman will treat each property of this object as a boolean test.
61
+
*`tests {object}`**Test-only**: This object is for you to populate. Postman will treat each property of this object as a boolean test.
62
62
*`iteration {number}`: Only available in the Collection Runner and Newman. Represents the current test run index. Starts from 0\.
63
63
64
-
Test-only: This object is only available in the test script section. Using this in a pre-request script will throw an error.
64
+
**Test-only**: This object is only available in the test script section. Using this in a pre-request script will throw an error.
65
65
66
66
### Data files
67
67
@@ -80,4 +80,4 @@ check out the [examples page][9].
0 commit comments