mirror of
https://github.com/zap-proto/fiber.git
synced 2026-10-30 15:06:23 +00:00
Fork of gofiber/fiber v3 based on the v3.2.0 tag. Rewrites all self-imports github.com/gofiber/fiber/v3 -> github.com/zap-proto/fiber/v3. Upstream gofiber/schema and gofiber/utils/v2 dependencies are left untouched. Co-authored-by: Hanzo Dev <[email protected]>
Fiber Client
Easy-to-use HTTP client based on fasthttp (inspired by resty and axios)
Features section describes in detail about Resty capabilities
Features
The characteristics have not yet been written.
- GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS, etc.
- Simple and chainable methods for settings and request
- Request Body can be
string,[]byte,map,slice- Auto detects
Content-Type - Buffer processing for
files - Native
*fasthttp.Requestinstance can be accessed during middleware and request execution viaRequest.RawRequest - Request Body can be read multiple time via
Request.RawRequest.GetBody()
- Auto detects
- Response object gives you more possibility
- Access as
[]bytebyresponse.Body()or access asstringbyresponse.String()
- Access as
- Automatic marshal and unmarshal for JSON and XML content type
- Default is JSON, if you supply struct/map without header Content-Type
- For auto-unmarshal, refer to -
- Success scenario Request.SetResult() and Response.Result().
- Error scenario Request.SetError() and Response.Error().
- Supports RFC7807 - application/problem+json & application/problem+xml
- Provide an option to override JSON Marshal/Unmarshal and XML Marshal/Unmarshal
Usage
The following samples will assist you to become as comfortable as possible with Fiber Client library.
// Import Fiber Client into your code and refer it as `client`.
import "github.com/gofiber/fiber/client"