Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 701 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 701 Bytes

Elegant Httpclient

What's this?

The project provides a simple httpclient that is implemented with Golang

Installation

To install Httpclient package, you need to install Go and set your Go workspace first.

$ go get -u github.com/wxning1107/httpclient

How to use?

	client := NewClient(&Config{
		RequestTimeout:      time.Second,
		DisableKeepAlives:   false,
		MaxIdleConns:        100,
		MaxIdleConnsPerHost: 2,
		MaxConnsPerHost:     0,
		IdleConnTimeout:     time.Second * 90,
		DisableBreaker:      true,
	})

	resp := client.Builder().
		URL("http://www.google.com").
		Method("GET").
		Headers(GetDefaultHeader()).
		Fetch(context.Background())