Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 681 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 681 Bytes

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 ...