fiber/client
M. Efe Çetin 3ba90c0fb0
docs: add docs for new client (#2991)
* docs: add docs for new client

* Add docs for client hooks

* Add docs for client examples

* Some fixes.

* docs: add docs for new client

* docs: add docs for new client

* Add more examples for methods

* Update docs/client/examples.md

Co-authored-by: Jason McNeil <sixcolors@mac.com>

* Add one more example for cookiejar

* apply review

* apply review

* apply review

* docs: add docs for new client

* docs: add docs for new client

---------

Co-authored-by: René <rene@gofiber.io>
Co-authored-by: Jason McNeil <sixcolors@mac.com>
2024-05-13 14:49:01 +02:00
..
README.md v3 (feature): client refactor (#1986) 2024-03-04 08:49:14 +01:00
client.go docs: add docs for new client (#2991) 2024-05-13 14:49:01 +02:00
client_test.go fix: Inconsistent and flaky unit-tests (#2892) 2024-03-08 20:03:13 +01:00
cookiejar.go v3 (feature): client refactor (#1986) 2024-03-04 08:49:14 +01:00
cookiejar_test.go chore: Enabling shuffling, cleanup and consistency across tests (#2931) 2024-03-24 20:54:56 +01:00
core.go v3 (feature): client refactor (#1986) 2024-03-04 08:49:14 +01:00
core_test.go chore: Update golangci-lint to v1.57.1 (#2929) 2024-03-24 20:32:13 +01:00
helper_test.go chore: Update golangci-lint to v1.57.1 (#2929) 2024-03-24 20:32:13 +01:00
hooks.go Fix some comments (#2983) 2024-04-24 11:12:06 +02:00
hooks_test.go chore: Update golangci-lint to enable more lint rules (#2923) 2024-03-18 14:50:40 +01:00
request.go docs: add docs for new client (#2991) 2024-05-13 14:49:01 +02:00
request_test.go chore: Update golangci-lint to v1.57.1 (#2929) 2024-03-24 20:32:13 +01:00
response.go docs: add docs for new client (#2991) 2024-05-13 14:49:01 +02:00
response_test.go fix: Inconsistent and flaky unit-tests (#2892) 2024-03-08 20:03:13 +01:00

README.md

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.Request instance can be accessed during middleware and request execution via Request.RawRequest
    • Request Body can be read multiple time via Request.RawRequest.GetBody()
  • Response object gives you more possibility
    • Access as []byte by response.Body() or access as string by response.String()
  • 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"

Simple GET