Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 670 Bytes

README.md

File metadata and controls

27 lines (22 loc) · 670 Bytes

rest-kit

GoDoc Build Status

Simple REST client helper written in Go.

Usage

import (
    "net/url"
    "github.com/pulcy/rest-kit"
)

c := restkit.NewRestClient(baseURL)
var user UserType
q := url.Values{}
q.Set("id", "some-user-id")
if err := c.Request("GET", "/user", q, nil, &user); err != nil {
    panic("GET /user failed")
}
// Modify user ...
if err := c.Request("POST", "/user", nil, user, nil); err != nil {
    panic("POST /user failed")
}