Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hewigovens committed Oct 4, 2024
1 parent 8296ad6 commit 334e991
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Features:

```toml
[dependencies]
reqwest-enum = "0.2.0"
reqwest-enum = "0.3.2"
```

## Example
Expand All @@ -44,7 +44,7 @@ pub enum HttpBin {
pub trait Target {
fn base_url(&self) -> &'static str;
fn method(&self) -> HTTPMethod;
fn path(&self) -> &'static str;
fn path(&self) -> String;
fn query(&self) -> HashMap<&'static str, &'static str>;
fn headers(&self) -> HashMap<&'static str, &'static str>;
fn authentication(&self) -> Option<AuthMethod>;
Expand All @@ -60,6 +60,10 @@ let response = provider.request(HttpBin::Get).await.unwrap();
assert_eq!(response.status(), 200);
```

Provider also allows you to customize the request by providing a `EndpointFn` or `RequestBuilderFn` closure if default behavior is not sufficient:
1. Need to use different endpoint based on the target.
2. Need to insert custom headers or intercept the final request.

### JSON-RPC

Full example can be found in [examples/ethereum-rpc](examples/ethereum-rpc).
Expand Down

0 comments on commit 334e991

Please sign in to comment.