HTTP mocking for Golang

httpmock Build Status Coverage Status GoDoc Version Mentioned in Awesome Go

Easy mocking of http responses from external resources.

Install

Currently supports Go 1.7 - 1.15.

v1 branch has to be used instead of master.

Using go modules (aka. go mod)

In your go files, simply use:

import "github.com/jarcoal/httpmock"

Then next go mod tidy or go test invocation will automatically populate your go.mod with the last httpmock release, now Version.

Note you can use go mod vendor to vendor your dependencies.

Using $GOPATH

v1 branch is configured as the default branch in github, so:

go get github.com/jarcoal/httpmock

automatically downloads the v1 branch in $GOPATH/src. Then in your go files use:

import "github.com/jarcoal/httpmock"

Vendoring, using govendor for example

When vendoring is used, v1 branch has to be specified. Two choices here:

  • preferred way:
    govendor fetch github.com/jarcoal/httpmock@v1
    
    then in go files:
    import "github.com/jarcoal/httpmock"
  • old way (before v1 was set as default branch), use gopkg to read from v1 branch:
    govendor fetch gopkg.in/jarcoal/httpmock.v1
    
    then in go files:
    import "gopkg.in/jarcoal/httpmock.v1"

Usage

Simple Example:

func TestFetchArticles(t *testing.T) {
  httpmock.Activate()
  defer httpmock.DeactivateAndReset()

  // Exact URL match
  httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles",
    httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`))

  // Regexp match (could use httpmock.RegisterRegexpResponder instead)
  httpmock.RegisterResponder("GET", `=~^https://api\.mybiz\.com/articles/id/\d+\z`,
    httpmock.NewStringResponder(200, `{"id": 1, "name": "My Great Article"}`))

  // do stuff that makes a request to articles
  ...

  // get count info
  httpmock.GetTotalCallCount()

  // get the amount of calls for the registered responder
  info := httpmock.GetCallCountInfo()
  info["GET https://api.mybiz.com/articles"] // number of GET calls made to https://api.mybiz.com/articles
  info["GET https://api.mybiz.com/articles/id/12"] // number of GET calls made to https://api.mybiz.com/articles/id/12
  info[`GET =~^https://api\.mybiz\.com/articles/id/\d+\z`] // number of GET calls made to https://api.mybiz.com/articles/id/<any-number>
}

Advanced Example:

func TestFetchArticles(t *testing.T) {
  httpmock.Activate()
  defer httpmock.DeactivateAndReset()

  // our database of articles
  articles := make([]map[string]interface{}, 0)

  // mock to list out the articles
  httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles",
    func(req *http.Request) (*http.Response, error) {
      resp, err := httpmock.NewJsonResponse(200, articles)
      if err != nil {
        return httpmock.NewStringResponse(500, ""), nil
      }
      return resp, nil
    },
  )

  // return an article related to the request with the help of regexp submatch (\d+)
  httpmock.RegisterResponder("GET", `=~^https://api\.mybiz\.com/articles/id/(\d+)\z`,
    func(req *http.Request) (*http.Response, error) {
      // Get ID from request
      id := httpmock.MustGetSubmatchAsUint(req, 1) // 1=first regexp submatch
      return httpmock.NewJsonResponse(200, map[string]interface{}{
        "id":   id,
        "name": "My Great Article",
      })
    },
  )

  // mock to add a new article
  httpmock.RegisterResponder("POST", "https://api.mybiz.com/articles",
    func(req *http.Request) (*http.Response, error) {
      article := make(map[string]interface{})
      if err := json.NewDecoder(req.Body).Decode(&article); err != nil {
        return httpmock.NewStringResponse(400, ""), nil
      }

      articles = append(articles, article)

      resp, err := httpmock.NewJsonResponse(200, article)
      if err != nil {
        return httpmock.NewStringResponse(500, ""), nil
      }
      return resp, nil
    },
  )

  // do stuff that adds and checks articles
}

Algorithm

When GET http://example.tld/some/path?b=12&a=foo&a=bar request is caught, all standard responders are checked against the following URL or paths, the first match stops the search:

  1. http://example.tld/some/path?b=12&a=foo&a=bar (original URL)
  2. http://example.tld/some/path?a=bar&a=foo&b=12 (sorted query params)
  3. http://example.tld/some/path (without query params)
  4. /some/path?b=12&a=foo&a=bar (original URL without scheme and host)
  5. /some/path?a=bar&a=foo&b=12 (same, but sorted query params)
  6. /some/path (path only)

If no standard responder matched, the regexp responders are checked, in the same order, the first match stops the search.

Ginkgo Example:

// article_suite_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
)
// ...
var _ = BeforeSuite(func() {
  // block all HTTP requests
  httpmock.Activate()
})

var _ = BeforeEach(func() {
  // remove any mocks
  httpmock.Reset()
})

var _ = AfterSuite(func() {
  httpmock.DeactivateAndReset()
})


// article_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
)

var _ = Describe("Articles", func() {
  It("returns a list of articles", func() {
    httpmock.RegisterResponder("GET", "https://api.mybiz.com/articles.json",
      httpmock.NewStringResponder(200, `[{"id": 1, "name": "My Great Article"}]`))

    // do stuff that makes a request to articles.json
  })
})

Ginkgo + Resty Example:

// article_suite_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
  "github.com/go-resty/resty"
)
// ...
var _ = BeforeSuite(func() {
  // block all HTTP requests
  httpmock.ActivateNonDefault(resty.DefaultClient.GetClient())
})

var _ = BeforeEach(func() {
  // remove any mocks
  httpmock.Reset()
})

var _ = AfterSuite(func() {
  httpmock.DeactivateAndReset()
})


// article_test.go

import (
  // ...
  "github.com/jarcoal/httpmock"
  "github.com/go-resty/resty"
)

var _ = Describe("Articles", func() {
  It("returns a list of articles", func() {
    fixture := `{"status":{"message": "Your message", "code": 200}}`
    responder := httpmock.NewStringResponder(200, fixture)
    fakeUrl := "https://api.mybiz.com/articles.json"
    httpmock.RegisterResponder("GET", fakeUrl, responder)

    // fetch the article into struct
    articleObject := &models.Article{}
    _, err := resty.R().SetResult(articleObject).Get(fakeUrl)

    // do stuff with the article object ...
  })
})
Comments
  • Capture the request body

    Capture the request body

    I think is not hard adds a Responder who capture the request body. I would like validate the request who arrive in http server. Something like that:

    func NewCaptureResponder(captor *Captor, res *http.Response) func(req *http.Request) (*http.Response, error) {
    	return func(req *http.Request) (*http.Response, error) {
    		buf := bytes.Buffer{}
    		_, err := io.Copy(&buf, req.Body)
    		if err != nil {
    			return nil, err
    		}
    		captor.Value = buf.String()
    		return res, nil
    	}
    }
    
    requestCaptor := Captor{}
    responder := NewCaptureResponder(&requestCaptor, httpmock.NewStringResponse(tt.givenStatus, tt.givenResponse))
    				httpmock.RegisterResponder(tt.givenMethod, tt.givenUrl, responder)
    

    What you think about? Make sense? If you agree. I could submit a pull request with that.

  • Data Race Issue

    Data Race Issue

    Let me start by saying, this might be entirely my fault, and I barely understand anything about Go.

    I'm attempting to convert a test from using a pretty ugly chunk of httptest code to httpmock:

    https://github.com/dropbox/changes-client/compare/handle-abortions...httpmock

    However, upon doing this we hit a race which only presents itself with httpmock:

    ==================
    WARNING: DATA RACE
    Write by goroutine 7:
      github.com/jarcoal/httpmock.Deactivate()
          /home/vagrant/src/github.com/jarcoal/httpmock/transport.go:139 +0x51
      github.com/jarcoal/httpmock.DeactivateAndReset()
          /home/vagrant/src/github.com/jarcoal/httpmock/transport.go:150 +0x2b
      github.com/dropbox/changes-client/engine.TestCompleteFlow()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine_test.go:296 +0x1b4c
      testing.tRunner()
          /usr/local/go/src/pkg/testing/testing.go:422 +0x10f
    
    Previous read by goroutine 11:
      net/http.(*Client).send()
          /usr/local/go/src/pkg/net/http/client.go:118 +0x39e
      net/http.(*Client).doFollowingRedirects()
          /usr/local/go/src/pkg/net/http/client.go:343 +0xd31
      net/http.(*Client).Get()
          /usr/local/go/src/pkg/net/http/client.go:275 +0xcd
      net/http.Get()
          /usr/local/go/src/pkg/net/http/client.go:252 +0x6e
      github.com/dropbox/changes-client/engine.(*UpstreamMonitor).fetchJobStep()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/upstream_monitor.go:55 +0x151
      github.com/dropbox/changes-client/engine.(*UpstreamMonitor).WaitUntilAbort()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/upstream_monitor.go:33 +0x6c
      github.com/dropbox/changes-client/engine.func·005()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:213 +0x95
    
    Goroutine 7 (running) created at:
      testing.RunTests()
          /usr/local/go/src/pkg/testing/testing.go:504 +0xb46
      testing.Main()
          /usr/local/go/src/pkg/testing/testing.go:435 +0xa2
      main.main()
          github.com/dropbox/changes-client/engine/_test/_testmain.go:47 +0xdc
    
    Goroutine 11 (running) created at:
      github.com/dropbox/changes-client/engine.(*Engine).runBuildPlan()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:217 +0x8c9
      github.com/dropbox/changes-client/engine.(*Engine).Run()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:75 +0x1e5
      github.com/dropbox/changes-client/engine.RunBuildPlan()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:59 +0x1a8
      github.com/dropbox/changes-client/engine.TestCompleteFlow()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine_test.go:196 +0xb7b
      testing.tRunner()
          /usr/local/go/src/pkg/testing/testing.go:422 +0x10f
    ==================
    ==================
    WARNING: DATA RACE
    Write by goroutine 7:
      github.com/jarcoal/httpmock.Reset()
          /home/vagrant/src/github.com/jarcoal/httpmock/transport.go:144 +0x4e
      github.com/jarcoal/httpmock.DeactivateAndReset()
          /home/vagrant/src/github.com/jarcoal/httpmock/transport.go:151 +0x30
      github.com/dropbox/changes-client/engine.TestCompleteFlow()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine_test.go:296 +0x1b4c
      testing.tRunner()
          /usr/local/go/src/pkg/testing/testing.go:422 +0x10f
    
    Previous read by goroutine 11:
      github.com/jarcoal/httpmock.(*MockTransport).responderForKey()
          /home/vagrant/src/github.com/jarcoal/httpmock/transport.go:63 +0x43
      github.com/jarcoal/httpmock.(*MockTransport).RoundTrip()
          /home/vagrant/src/github.com/jarcoal/httpmock/transport.go:41 +0x10e
      net/http.send()
          /usr/local/go/src/pkg/net/http/client.go:195 +0x62d
      net/http.(*Client).send()
          /usr/local/go/src/pkg/net/http/client.go:118 +0x200
      net/http.(*Client).doFollowingRedirects()
          /usr/local/go/src/pkg/net/http/client.go:343 +0xd31
      net/http.(*Client).Get()
          /usr/local/go/src/pkg/net/http/client.go:275 +0xcd
      net/http.Get()
          /usr/local/go/src/pkg/net/http/client.go:252 +0x6e
      github.com/dropbox/changes-client/engine.(*UpstreamMonitor).fetchJobStep()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/upstream_monitor.go:55 +0x151
      github.com/dropbox/changes-client/engine.(*UpstreamMonitor).WaitUntilAbort()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/upstream_monitor.go:33 +0x6c
      github.com/dropbox/changes-client/engine.func·005()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:213 +0x95
    
    Goroutine 7 (running) created at:
      testing.RunTests()
          /usr/local/go/src/pkg/testing/testing.go:504 +0xb46
      testing.Main()
          /usr/local/go/src/pkg/testing/testing.go:435 +0xa2
      main.main()
          github.com/dropbox/changes-client/engine/_test/_testmain.go:47 +0xdc
    
    Goroutine 11 (running) created at:
      github.com/dropbox/changes-client/engine.(*Engine).runBuildPlan()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:217 +0x8c9
      github.com/dropbox/changes-client/engine.(*Engine).Run()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:75 +0x1e5
      github.com/dropbox/changes-client/engine.RunBuildPlan()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine.go:59 +0x1a8
      github.com/dropbox/changes-client/engine.TestCompleteFlow()
          /home/vagrant/src/github.com/dropbox/changes-client/engine/engine_test.go:196 +0xb7b
      testing.tRunner()
          /usr/local/go/src/pkg/testing/testing.go:422 +0x10f
    ==================
    
  • Implemented test case with mock. but it's not working

    Implemented test case with mock. but it's not working

    I implemented a code to get data from the API. And also wrote the test case with mock to that method by using https://github.com/jarcoal/httpmock. But mocking was not executing. Getting original data from the data. not getting mock data. tried in all the ways. but not working. can anyone help me please?

    func MakeAPIRequest(url string) ([]byte, error) {
        req, err := http.NewRequest(http.MethodGet, url, nil)
        if err != nil {
            log.Fatal(err)
        }
        tr := &http.Transport{
            TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
        }
        httpClient := &http.Client{Transport: tr}
        response, err := httpClient.Do(req)
        if err != nil {
            log.Fatal(err)
        }
        defer response.Body.Close()
        body, err := ioutil.ReadAll(response.Body)
        if err != nil {
            log.Fatal(err)
        }
        return body, nil
    }
    

    Test case code Is

    func TestMakeAPIRequest(t *testing.T) {
        httpmock.Activate()
        defer httpmock.DeactivateAndReset()
        httpmock.RegisterResponder("GET", "https://jsonplaceholder.typicode.com/users/1",
            httpmock.NewStringResponder(200, `{
                "id": 1,
                "name": "Leanne Graham Test Name",
                "username": "Bret",
                "email": "[email protected]",
                "address": {
                  "street": "Kulas Light",
                  "suite": "Apt. 556",
                  "city": "Gwenborough",
                  "zipcode": "92998-3874",
                  "geo": {
                    "lat": "-37.3159",
                    "lng": "81.1496"
                  }
                },
                "phone": "1-770-736-8031 x56442",
                "website": "hildegard.org",
                "company": {
                  "name": "Romaguera-Crona",
                  "catchPhrase": "Multi-layered client-server neural-net",
                  "bs": "harness real-time e-markets"
                }
              }`))
    
        data, err := MakeAPIRequest("https://jsonplaceholder.typicode.com/users/1")
        fmt.Println("data:", string(data), err)
        fmt.Println(httpmock.GetCallCountInfo())
    }
    

    getting 0 when call fmt.Println(httpmock.GetCallCountInfo())

    https://stackoverflow.com/questions/64769575/implemented-test-case-with-mock-but-its-not-working

  • Request do not propagate to package functions

    Request do not propagate to package functions

    I'm trying to mock a URL that a function requests at the package I'm testing and it still executes the request to the original URL instead of the mocked one that we defined. Is there support for acessing mocked urls at package functions or only inside the test?

    mockedResponse := map[string]interface{}{
            "data": []map[string]interface{}{
                map[string]interface{}{
                    "key": "pipitchu",
                },
            },
            "message": nil,
            "success": true,
        }
    
            url := "https://test.pipitchu.com/123"
        httpmock.RegisterResponder("GET", url,
            func(req *http.Request) (*http.Response, error) {
                resp, err := httpmock.NewJsonResponse(200, mockedResponse)
                if err != nil {
                    return httpmock.NewStringResponse(500, ""), nil
                }
                return resp, nil
            },
        )
    
    key, err := GetKey(123456)
    // key is the "key" key of the first element of the data array
    assert(t, "pipitchu", key)
    // we're using testify
    

    Thanks in advance!

  • Travis-ci: added support for ppc64le

    Travis-ci: added support for ppc64le

    Signed-off-by: Devendranath Thadi [email protected]

    Added power support for the travis.yml file with ppc64le. This is part of the Ubuntu distribution for ppc64le. This helps us simplify testing later when distributions are re-building and re-releasing.

  • Unable to emulate the http mock server

    Unable to emulate the http mock server

    I followed the instructions given on the readme to setup a mock http server. However when I run the test I always get host not found exception which is the result that my httpclient instead of connecting to the mock server is trying to connect to an actual server.

    Please advice.

    Great work by the way

  • No respond for URL question

    No respond for URL question

    I am using httpmock for testing my REST client recently.

    The version of httpmock is github.com/jarcoal/httpmock v1.0.8

    I have a piece of test code, it looks not that complicated, but it always panic 2021/12/16 22:17:24 Response err:Get "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123": no responder found

    The test code is like below:

    func TestGetResources(t *testing.T) {
    	httpmock.Activate()
    	defer httpmock.DeactivateAndReset()
    
    	host := "test.com"
    	path := "/ltm/test_resources/"
    	username := "admin"
    	password := "password"
    	inscure := true
    
    	se := InitSession(host, username, password, inscure)
    	se.Client = &http.Client{}
    	serv := Service{
    		Path:    path,
    		Session: se,
    	}
    	partition := "Project_test123"
    	// url := "https://" + host + serv.URIForPartition(partition)
    	// url := `https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123` (not work)
    	url := "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123"
    	// url := "/ltm/test_resources" (not work)
    
    	resp := []byte("hello")
    
            // I register a byte responder for
            // URL  "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123"
    	httpmock.RegisterResponder(
    		"GET", url, httpmock.NewBytesResponder(200, resp),
    	)
    
    	body := serv.GetResources(partition)
    
    	assert.Equal(t, *body, resp)
    
    }
    

    when I run the test, it always returns panic:

    === RUN   TestGetResources
    2021/12/16 22:17:24 Get Reousrces
    2021/12/16 22:17:24 Request URL is: https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123
    2021/12/16 22:17:24 Response err:Get "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123": no responder found
    --- FAIL: TestGetResources (0.00s)
    panic: Repsonse err:Get "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123": no responder found [recovered]
            panic: Repsonse err:Get "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123": no responder found
    

    As you can see I log the Request URL is: https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123, it is the same as I registered for the Responder.

    Request URL is: https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123
            url := "https://test.com/ltm/test_resources/?$filter=partition%20eq%20Project_test123"
    

    I referred to this issue #106 to try to use /ltm/test_resources to match any path with it. it does not work either.

  • Mock not working

    Mock not working

    I have my http client using transport : [ client := &http.Client{Transport: tr} ]. When I do a mock on this, it fails. Whereas if I remove the transport [ client := &http.Client{} ], it works. Could you please explain a solution to this issue ?

  • Issue while using ActivateNonDefault

    Issue while using ActivateNonDefault

    I'm using ActivateNonDefault for activating the mocks on my custom client but I see it not intercepting the calls. My client is using http.DefaultTransport for transport which I'm passing client := &http.Client{Transport: http.DefaultTransport} httpmock.ActivateNonDefault(client) while activating the client.,I also tried passing the way it is in documentation which did not help me., Can someone help me.,Thanks in advance!

  • Query paramter with no value

    Query paramter with no value

    Recent change #50 in the v1 branch breaks the behavior of query parameter without values. Query parameter with no value is valid due to RFC 3986. Here's a patch to test the case.

    --- a/transport_test.go
    +++ b/transport_test.go
    @@ -217,6 +217,9 @@ func TestMockTransportPathOnlyFallback(t *testing.T) {
     		"/hello/world?query=string&query=string2": {
     			testUrl + "hello/world?query=string&query=string2",
     		},
    +		"/hello/world?query": {
    +			testUrl + "hello/world?query",
    +		},
     		"/hello/world#fragment": {
     			testUrl + "hello/world#fragment",
     		},
    

    Ping to the related patch authors: @konalegi (for #50), @Zanadar (for #55) and @maxatome (for #61)

  • Address query sort issues

    Address query sort issues

    A recent change to HTTP mock added some code that allowed Registering a responder with a query where query order does not matter. This was a great change, but the implementation had an issue: it is perfectly valid for multiple query params to have the same key. Languages and HTTP libraries handle this situation in various ways, but in Go, the standard library handles it by combining the values into a slice. Thus:

    func main() {
    	u, err := url.Parse("http://bing.com/search?q=dotnet&q=aaa")
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Println(u.Query())
    	
    }
    
    $ map[q:[dotnet aaa]]
    

    https://play.golang.org/p/x0P-dhI85sh

    In addressing this problem, I discovered another issue. Existing code was sorting Querys and considering urls with query params in different order to be different. Reasonable people could disagree about this, but there seems to be general consensus that this second part (considering order of query params as significant) is incorrect. If you think of a query as a map of keys to values (which is the type used internally in Go), order does not enter into it. Image a server dealing with multiple params. It wouldn't care about their order in general. It would treat the keys and values as individual query and handle them in a transparent order that callers would never know or care about.

    Thus, I submit this PR with the following intent:

    Instead of have callers of RegisterResponder care about query order and adding new methods to get around this confusion, RoundTrip and RegisterResponder should canonicalize querys, using the Go standard libraries url.Query().Encode() to avoid confusion around query param order. Thus all urls containing the same query params, whatever the order, will be considered equivalent for matching to responders.

  • Question: how to sponsor this project?

    Question: how to sponsor this project?

    Hi 👋 ,

    Thanks so much for the work on this project! At @Reviewpad, we are trying to support the OSS projects that we use as dependencies to our main repository reviewpad/reviewpad.

    Do you plan to join any sponsoring program? We are also happy to help the community to maintain the project.

    Thanks!

Http client call for golang http api calls

httpclient-call-go This library is used to make http calls to different API services Install Package go get

Oct 7, 2022
fhttp is a fork of net/http that provides an array of features pertaining to the fingerprint of the golang http client.

fhttp The f stands for flex. fhttp is a fork of net/http that provides an array of features pertaining to the fingerprint of the golang http client. T

Jan 1, 2023
NATS HTTP Round Tripper - This is a Golang http.RoundTripper that uses NATS as a transport.

This is a Golang http.RoundTripper that uses NATS as a transport. Included is a http.RoundTripper for clients, a server that uses normal HTTP Handlers and any existing http handler mux and a Caddy Server transport.

Dec 6, 2022
Http-conection - A simple example of how to establish a HTTP connection using Golang

A simple example of how to establish a HTTP connection using Golang

Feb 1, 2022
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http

fasthttp Fast HTTP implementation for Go. Currently fasthttp is successfully used by VertaMedia in a production serving up to 200K rps from more than

Jan 2, 2023
Simple HTTP package that wraps net/http

Simple HTTP package that wraps net/http

Jan 17, 2022
An enhanced http client for Golang
An enhanced http client for Golang

go-http-client An enhanced http client for Golang Documentation on go.dev ?? This package provides you a http client package for your http requests. Y

Dec 23, 2022
Go (golang) http calls with retries and backoff

pester pester wraps Go's standard lib http client to provide several options to increase resiliency in your request. If you experience poor network co

Dec 28, 2022
http client for golang
http client for golang

Request HTTP client for golang, Inspired by Javascript-axios Python-request. If you have experience about axios or requests, you will love it. No 3rd

Dec 18, 2022
A nicer interface for golang stdlib HTTP client

rq A nicer interface for golang stdlib HTTP client Documents rq: here client: here jar: here Why? Because golang HTTP client is a pain in the a... Fea

Dec 12, 2022
A fantastic HTTP request libarary used in Golang.

goz A fantastic HTTP request library used in golang. Inspired by guzzle Installation go get -u github.com/idoubi/goz Documentation API documentation

Dec 21, 2022
An HTTP performance testing tool written in GoLang

Gonce A HTTP API performance testing tool written in GoLang Description Installation Usage Description A performance testing tool written in GoLang. S

Jan 28, 2022
httpreq is an http request library written with Golang to make requests and handle responses easily.

httpreq is an http request library written with Golang to make requests and handle responses easily. Install go get github.com/binalyze/http

Feb 10, 2022
Declarative golang HTTP client

go-req Declarative golang HTTP client package req_test

Dec 20, 2022
A golang tool which makes http requests and prints the address of the request along with the MD5 hash of the response.

Golang Tool This repository is a golang tool which makes http requests to the external server and prints the address of the request along with the MD5

Oct 17, 2021
GoLang Smart HTTP Flood

smart-httpflood Golgang smart http flood This script supports HTTP Version, Cookie and Post Data. Installation: apt install snapd snap install go --cl

Dec 30, 2021
Advanced HTTP client for golang.

go-request Advanced HTTP client for golang. Installation go get github.com/mingming-cn/go-request Usage import ( "github.com/mingming-cn/go-reque

Nov 22, 2021
This is repository for Simple HTTP GET golang app that counts standard deviation from random.org integers

Simple Get Deviation App This is repository for Simple HTTP GET golang app that counts standard deviation from random.org integers IMPORTANT: Because

Jan 10, 2022
Full-featured, plugin-driven, extensible HTTP client toolkit for Go

gentleman Full-featured, plugin-driven, middleware-oriented toolkit to easily create rich, versatile and composable HTTP clients in Go. gentleman embr

Dec 23, 2022