Skip to content
/ api Public

Package api is a helper that simplifies the process of REST APIs bindings creation in Go.

License

Notifications You must be signed in to change notification settings

xlab/api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

API

GoDoc

Installation:

go get github.com/xlab/api

Use case:

svc, _ := api.New("http://example.com")
args := url.Values{}
args.Set("filter", "1")
args.Set("price", "200")
req, _ := svc.Request(api.POST, "/categories/1", args)

// req.URL is now http://example.com/categories/1
// req.Body is now filter=1&price=200
// req.Header now has Content-Type: application/x-www-form-urlencoded

var cli http.Client
resp, err := cli.Do(req)

License

MIT

About

Package api is a helper that simplifies the process of REST APIs bindings creation in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages