go-rest

command module
v0.0.0-...-dfd3d55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2015 License: MIT Imports: 2 Imported by: 0

README

go-rest

A simple toolkit for building more useful HTTP clients.

Tested on all Go versions 1.0 and higher.

Getting started

package main

import "fmt"
import "github.com/danryan/go-rest/rest"

type githubUser struct {
  Login string `json:"login"`
  Name  string `json:"name"`
}

func main() {
  c, _ := rest.New("https://api.github.com", nil)
  c.Header.Set("Content-Type", "application/json")
  c.Header.Set("Accept", "application/json")

  user := &githubUser{}

  _, err := c.Get("users/danryan", user)
  if err != nil {
    panic(err)
  }

  fmt.Printf("%s's name is %s\n", user.Login, user.Name)
}

Resources

Is it any good?

Possibly.

License

This library is distributed under the MIT License, a copy of which can be found in the LICENSE file.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL