Commit graph

17 commits

Author SHA1 Message Date
Vincent Ambo
2349dd22c3 feat: Split tls_key_password into a separate function
WHen configuring a PKCS12 certificate it is more useful to be able to
set this separately, as the `tls_client_key` function is never called.
2019-02-26 17:30:53 +01:00
Vincent Ambo
37dc54f2bf feat: Add utility functions for TLS client certificate usage 2019-02-26 17:30:53 +01:00
Vincent Ambo
791e2958fc test: Add test for token-based authentication (bearer_auth) 2019-02-26 17:30:53 +01:00
Vincent Ambo
b493bc3c84 docs(lib): Document available features and update example 2019-02-26 17:30:49 +01:00
Vincent Ambo
de16d9698d feat: Add optional Request::basic_auth utility function
This function adds a dependency on `base64` and is thus gated behind
the (enabled by default) `basic_auth` feature.
2019-02-26 17:30:49 +01:00
Vincent Ambo
bd726c7d4c feat: Add Response::is_success utility method 2019-02-26 17:30:49 +01:00
Vincent Ambo
415e930a07 feat: Add bearer_auth helper function
Adds a helper function for setting `Bearer`-tokens in `Authorization`
headers.
2019-02-26 17:30:49 +01:00
Vincent Ambo
aedfd7c7ac feat: Add support for form-encoded POST bodies 2019-02-26 17:30:49 +01:00
Vincent Ambo
d3a47d3b1c refactor: Move URL & method configuration to send()
This lets the builder proceed without returning a `Result` from the
initial call, which makes for a slightly nicer API.
2019-02-26 17:30:49 +01:00
Vincent Ambo
9ce0098bc0 docs(lib): Update docstrings for rustdoc output 2019-02-26 17:30:45 +01:00
Vincent Ambo
569e10e509 test: Add tests for HTTP verbs & POSTing data 2019-02-26 14:45:06 +01:00
Vincent Ambo
b71b44a672 fix: Correctly configure body sizes before setting read_function 2019-02-26 14:33:42 +01:00
Vincent Ambo
718d945753 refactor: Use mut self-consuming builder functions
Writing the functions this way makes it slightly nicer to chain them
without having to assign the request to an intermediate variable.
2019-02-26 14:33:02 +01:00
Vincent Ambo
c6c1746428 refactor: Introduce json feature and make it optional
Gates support for `serde_json` behind a Cargo feature called `json`
that is enabled by default.
2019-02-26 13:49:43 +01:00
Vincent Ambo
479a6b3442 feat: Support JSON body serialization in requests & responses
Uses `serde_json` to provide serialisation and deserialisation of
request/response bodies.
2019-02-26 13:46:02 +01:00
Vincent Ambo
b28f6e748d feat: Initial check-in of working client layer 2019-02-26 11:20:38 +01:00
Vincent Ambo
e95a82ca4c chore: Initial commit 2019-02-25 18:03:21 +01:00