fiber/client
Sumit Kumar 26cc477500
🔥 feat: Add support for CBOR encoding (#3173)
* feat(cbor): allow encoding response bodies in cbor

* fix(tests::cbor): encode struct instead of a randomly ordered hashmap

* docs(whats_new): add cbor in context section

* feat(binder): introduce CBOR

* feat(client): allow cbor in fiber client

* chore(tests): add more test

* chore(packages): go mod tidy

* fix(binder): update CBOR name and test

* improve test coverage

* improve test coverage

* update1

* add docs

* doc fixes

* update

* Fix markdown lint

* Add missing entry from binder README

* add/refresh documentation

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: M. Efe Çetin <efectn@protonmail.com>
Co-authored-by: RW <rene@gofiber.io>
2024-12-01 11:03:50 +01:00
..
README.md v3 (feature): client refactor (#1986) 2024-03-04 08:49:14 +01:00
client.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
client_test.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
cookiejar.go v3: Use Named Fields Instead of Positional and Align Structures to Reduce Memory Usage (#3079) 2024-07-23 08:37:45 +02: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: Bump golangci-lint to v1.60.3 (#3119) 2024-09-02 15:38:59 +02:00
helper_test.go chore: Update golangci-lint to v1.57.1 (#2929) 2024-03-24 20:32:13 +01:00
hooks.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
hooks_test.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
request.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
request_test.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
response.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +01:00
response_test.go 🔥 feat: Add support for CBOR encoding (#3173) 2024-12-01 11:03:50 +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