doc.go 697 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2012-2013 Jason McVetta. This is Free Software, released
  2. // under the terms of the GPL v3. See http://www.gnu.org/copyleft/gpl.html for
  3. // details. Resist intellectual serfdom - the ownership of ideas is akin to
  4. // slavery.
  5. /*
  6. Package napping is a client library for interacting with RESTful APIs.
  7. Example:
  8. type Foo struct {
  9. Bar string
  10. }
  11. type Spam struct {
  12. Eggs int
  13. }
  14. payload := Foo{
  15. Bar: "baz",
  16. }
  17. result := Spam{}
  18. url := "http://foo.com/bar"
  19. resp, err := napping.Post(url, &payload, &result, nil)
  20. if err != nil {
  21. panic(err)
  22. }
  23. if resp.Status() == 200 {
  24. println(result.Eggs)
  25. }
  26. See the "examples" folder for a more complete example.
  27. */
  28. package napping