Skip to content

Commit

Permalink
docs: add rawHeaders in mock docs (#2527)
Browse files Browse the repository at this point in the history
  • Loading branch information
kschat committed Oct 13, 2023
1 parent 6987327 commit c897aa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -1228,7 +1228,7 @@ The returned call objects have the following properties:
- `body` - the body of the call, if any
- `status` - the HTTP status of the reply (e.g. `200`)
- `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)
- `headers` - the headers of the reply
- `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']`)
- `reqheader` - the headers of the request

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):
Expand Down

0 comments on commit c897aa3

Please sign in to comment.