|
|
**Attention!** You must install the `http-cookies` gem to use this feature.
|
|
|
|
|
|
The cookies plugin allows to pass cookies in requests, and allow cookies to be passed to subsequent requests.
|
|
|
|
|
|
How to pass cookies:
|
|
|
|
|
|
```ruby
|
|
|
http = HTTPX.plugin(:cookies)
|
|
|
http.cookies("foo" => "bar").get("https://example.com")
|
|
|
```
|
|
|
|
|
|
How to pass along cookies:
|
|
|
|
|
|
```ruby
|
|
|
http = HTTPX.plugin(:cookies)
|
|
|
response = http.get("https://example.com/setscookies")
|
|
|
cookies = response.cookie_jar
|
|
|
http.cookies(cookies).get("https://example.com/another")
|
|
|
```
|
|
|
|
|
|
Next: [Compression](Compression) |
|
|
\ No newline at end of file |