Skip to content

Commit c897aa3

Browse files
authored
docs: add rawHeaders in mock docs (#2527)
1 parent 6987327 commit c897aa3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ The returned call objects have the following properties:
12281228
- `body` - the body of the call, if any
12291229
- `status` - the HTTP status of the reply (e.g. `200`)
12301230
- `response` - the body of the reply which can be a JSON, string, hex string representing binary buffers or an array of such hex strings (when handling `content-encoded` in reply header)
1231-
- `headers` - the headers of the reply
1231+
- `rawHeaders` - the headers of the reply which are formatted as a flat array containing header name and header value pairs (e.g. `['accept', 'application/json', 'set-cookie', 'my-cookie=value']`)
12321232
- `reqheader` - the headers of the request
12331233

12341234
If you save this as a JSON file, you can load them directly through `nock.load(path)`. Then you can post-process them before using them in the tests. For example, to add request body filtering (shown here fixing timestamps to match the ones captured during recording):

0 commit comments

Comments
 (0)