/httpcli

light http request client

Primary LanguageGoApache License 2.0Apache-2.0

httpcli

httpcli is better choice for http request.

License Go Report Card GoDoc Build Status Coverage Status

Brief

implements a friendly API for net/http standard library.

Features

  • simpler Get、Post request
  • decorate function param settings

Example

Get a page

	req := httpcli.Get("https://www.google.com").WithTLS()
	response, err := req.Response()
	if err != nil {
		fmt.Println("err:", err)
	} else {
		fmt.Println("result:",response.String())
	}

Post a req

	req := Post("https://baidu.com").WithTLS().
    		WithParam("wd", "查询")
	response, err := req.Response()
	if err != nil {
		fmt.Println("err:", err)
	} else {
		fmt.Println("result:",response.String())
	}