Skip to content

Commit

Permalink
README: Fix spacing on example, add features list (#84)
Browse files Browse the repository at this point in the history
* README: Fix spacing on example

* README: Add features

* Update README.md

* Update README.md
  • Loading branch information
earthboundkid authored Aug 4, 2023
1 parent c343f00 commit a9b646a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@

Requests also comes with tools for building custom http transports, include a request recorder and replayer for testing.

## Features

- Simplifies HTTP client usage compared to net/http
- Can't forget to close response body
- Checks status codes by default
- Supports context.Context
- JSON serialization and deserialization helpers
- Easily manipulate URLs and query parameters
- Request recording and replaying for tests
- Customizable transports and validators that are compatible with the standard library and third party libraries
- No third party dependencies
- Good test coverage

## Examples
### Simple GET into a string

Expand Down Expand Up @@ -270,10 +283,10 @@ err := requests.
It depends on exactly what you need in terms of file atomicity and buffering, but this will work for most cases:

```go
err := requests.
URL("http://example.com").
ToFile("myfile.txt").
Fetch(ctx)
err := requests.
URL("http://example.com").
ToFile("myfile.txt").
Fetch(ctx)
```

For more advanced use case, use `ToWriter`.
Expand Down

0 comments on commit a9b646a

Please sign in to comment.