Browse Source

document how to include cookies in a request #107

http2
Sindre Sorhus 9 years ago
parent
commit
b045f6d1f5
  1. 16
      readme.md

16
readme.md

@ -201,6 +201,22 @@ got('todomvc.com', {
```
## Cookies
You can use the [`cookie`](https://github.com/jshttp/cookie) module to include cookies in a request:
```js
const got = require('got');
const cookie = require('cookie');
got('google.com', {
headers: {
cookie: cookie.serialize('foo', 'bar')
}
});
```
## Unix Domain Sockets
Requests can also be sent via [unix domain sockets](http://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket). Use the following URL scheme: `PROTOCOL://unix:SOCKET:PATH`.

Loading…
Cancel
Save