Commit Graph

14 Commits

Author SHA1 Message Date
soruh
61e2402045 deprecate using SerdeValue, SerdeMap and serde_to_value
as they are just wrapper around serde_json::{Value, Map, to_value}.
Instead expose the serde_json and serde crates used.
2021-12-17 20:12:07 +01:00
soruh
59f1fab4d3 allow send_json to send any serde::Serialize value 2021-12-17 20:12:07 +01:00
Jacob Hoffman-Andrews
56276c3742 Add support for alternate TLs implementations. 2021-12-17 17:47:30 +01:00
Jacob Hoffman-Andrews
e36c1c2aa1 Switch to Result-based API. (#132)
Gets rid of synthetic_error, and makes the various send_* methods return `Result<Response, Error>`.
Introduces a new error type "HTTP", which represents an error due to status codes 4xx or 5xx.
The HTTP error type contains a boxed Response, so users can read the actual response if they want.
Adds an `error_for_status` setting to disable the functionality of treating 4xx and 5xx as errors.
Adds .unwrap() to a lot of tests.

Fixes #128.
2020-10-17 00:40:48 -07:00
Rob Young
28bdb89175 Set a default content type for JSON requests
When sending a JSON request a Content-Type of application/json is
usually wanted. This is often set as a default for JSON methods by HTTP
clients so can be confusing when it is not set. However, we do not want
to prevent the user from setting their own Content-Type.
2020-02-06 07:57:00 +01:00
Martin Algesten
5ba6b3cd4d edition 2018, clippy, fmt 2018-12-18 13:17:19 +01:00
Martin Algesten
f5a4c83819 refactor into unit 2018-06-30 13:05:36 +02:00
Martin Algesten
cd4a1722fa reduce dependency tree by features 2018-06-22 15:02:13 +02:00
Martin Algesten
e9ccf1c2cc use charset encoding for send_string 2018-06-22 11:38:44 +02:00
Martin Algesten
0a828bb4a5 cargo fmt 2018-06-22 10:16:37 +02:00
Martin Algesten
5f975270bf send_str to send_string 2018-06-22 10:13:31 +02:00
Martin Algesten
9514bd2743 query string test 2018-06-17 00:25:40 +02:00
Martin Algesten
6b63aab605 tests 2018-06-16 12:43:37 +02:00
Martin Algesten
7e3ad42674 content length 2018-06-16 12:35:51 +02:00