doc tweaks

This commit is contained in:
HoneyryderChuck 2022-08-16 11:52:21 +01:00
parent 16a64ba953
commit bb481022fa

View File

@ -9,7 +9,7 @@ https://gitlab.com/honeyryderchuck/httpx/-/wikis/Timeouts
The following timeouts are now supported:
* `:write_timeout`: total time (in seconds) to write a request to the server;
* `:read_timeout`: total time (in seconds) to read aa response from the server;
* `:read_timeout`: total time (in seconds) to read a response from the server;
* `:request_timeout`: tracks both of the above (time to write the request and read a response);
```ruby
@ -26,6 +26,8 @@ https://gitlab.com/honeyryderchuck/httpx/-/wikis/Circuit-Breaker
The `:circuit_breaker` plugin wraps around errors happening when performing HTTP requests, and support options for setting maximum number of attempts before circuit opens (`:circuit_breaker_max_attempts`), period after which attempts should be reset (`:circuit_breaker_reset_attempts_in`), timespan until circuit half-opens (`circuit_breaker_break_in`), respective half-open drip rate (`:circuit_breaker_half_open_drip_rate`), and a callback to do your own check on whether a response has failed, in case you want HTTP level errors to be marked as failed attempts (`:circuit_breaker_break_on`).
Read the wiki for more info about the defaults.
```ruby
http = HTTPX.plugin(:circuit_breaker)
# that's it!
@ -49,7 +51,7 @@ res = webdav.copy("/file.html", "/newdir/copy.html")
### XML transcoder, `:xml` option and `response.xml`
A new transcoder was added fot the XML mime type, which requires `"nokogiri"` to be installed; it can both serialize Nokogiri nodes in a request, and parse response content into nokogiri nodes:
A new transcoder was added fot the XML mime type, which requires `"nokogiri"` to be installed. It can both serialize Nokogiri nodes in a request, and parse response content into nokogiri nodes:
```ruby
response = HTTPX.post("https://xml-server.com", xml: Nokogiri::XML("<xml ..."))