A library to facilitate the creation of http requests


Use go get command to retrieve the package (Go ^1.19 is required):

go get -u

Quick Start

  1. Import it in your code:
import ""
  1. Set up a HTTP Client:

client := requestfy.NewClient(
  1. Make a request:
res, err := client.Request().Get("people/1/")


Replacing JSON decoder

When starting the client with the default configuration (requestfy.ConfigDefault()) json.Decoder is used.

To replace json.Decoder with another implementation it is necessary to specify the decoder constructor during the creation of the client with the option ConfigJsonDecoder.

Using go-json

To use go-json just “teach” the client how to build the new decoder:

import ""

func main() {
    client := client := requestfy.NewClient(
        requestfy.ConfigDefault(), // Using "ConfigDefault" is optional and its settings may be overwritten by subsequent settings
        requestfy.ConfigJsonDecoder(func(r io.Reader) requestfy.Decoder {
            return json.NewDecoder(r)


View Github