|
| 1 | +<h1 align="center">Fiber Client</h1> |
| 2 | +<p align="center">Easy-to-use HTTP client based on fasthttp (inspired by <a href="https://github.com/go-resty/resty">resty</a> and <a href="https://github.com/axios/axios">axios</a>)</p> |
| 3 | +<p align="center"><a href="#features">Features</a> section describes in detail about Resty capabilities</p> |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +> The characteristics have not yet been written. |
| 8 | +
|
| 9 | +- GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS, etc. |
| 10 | +- Simple and chainable methods for settings and request |
| 11 | +- Request Body can be `string`, `[]byte`, `map`, `slice` |
| 12 | + - Auto detects `Content-Type` |
| 13 | + - Buffer processing for `files` |
| 14 | + - Native `*fasthttp.Request` instance can be accessed during middleware and request execution via `Request.RawRequest` |
| 15 | + - Request Body can be read multiple time via `Request.RawRequest.GetBody()` |
| 16 | +- Response object gives you more possibility |
| 17 | + - Access as `[]byte` by `response.Body()` or access as `string` by `response.String()` |
| 18 | +- Automatic marshal and unmarshal for JSON and XML content type |
| 19 | + - Default is JSON, if you supply struct/map without header Content-Type |
| 20 | + - For auto-unmarshal, refer to - |
| 21 | + - Success scenario Request.SetResult() and Response.Result(). |
| 22 | + - Error scenario Request.SetError() and Response.Error(). |
| 23 | + - Supports RFC7807 - application/problem+json & application/problem+xml |
| 24 | + - Provide an option to override JSON Marshal/Unmarshal and XML Marshal/Unmarshal |
| 25 | + |
| 26 | +## Usage |
| 27 | + |
| 28 | +The following samples will assist you to become as comfortable as possible with `Fiber Client` library. |
| 29 | + |
| 30 | +```go |
| 31 | +// Import Fiber Client into your code and refer it as `client`. |
| 32 | +import "github.com/gofiber/fiber/client" |
| 33 | +``` |
| 34 | + |
| 35 | +### Simple GET |
0 commit comments