Skip to content

Commit

Permalink
Documented response.caseless.get() (request#2995)
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeisfoo authored and reconbot committed Nov 23, 2018
1 parent 39e3d50 commit 5ee8906
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -940,6 +940,17 @@ Function that creates a new cookie jar.
request.jar()
```

### response.caseless.get('header-name')

Function that returns the specified response header field using a [case-insensitive match](https://tools.ietf.org/html/rfc7230#section-3.2)

```js
request('http://www.google.com', function (error, response, body) {
// print the Content-Type header even if the server returned it as 'content-type' (lowercase)
console.log('Content-Type is:', response.caseless.get('Content-Type'));
});
```

[back to top](#table-of-contents)


Expand Down

0 comments on commit 5ee8906

Please sign in to comment.