Skip to content

galacticminter/go-request

 
 

Repository files navigation

go-request

Build Status

This is a simple convenience library for making service requests and deserializing the results to objects either from JSON or from XML.

Usage

Here is an exmple of fetching an object:

myObject := MyObject{}
reqErr := request.NewRequest().AsGet().WithUrl("http://myservice.com/api/foo").JSON(&myObject)

Here is an example of fetching a raw response:

res, res_err := request.NewRequest().AsGet().WithUrl(host).WithTimeout(5000).FetchRawResponse()
defer res.Body.Close()
//... do things with the raw body ...

About

A simple library for making http requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.7%
  • Makefile 0.3%