Documentation ¶
Index ¶
Constants ¶
View Source
const ContentType = "application/json"
ContentType is the default mime type for JSON
Variables ¶
View Source
var DefaultClient = NewClient()
DefaultClient is the singleton instance of jsonclient using http.DefaultClient
Functions ¶
Types ¶
type Client ¶
type Client interface { Get(url string, response interface{}) error Post(url string, request interface{}, response interface{}) error Headers() http.Header ErrorResponse(err error, response interface{}) bool }
func NewClient ¶
func NewClient() Client
NewClient returns a new JSON Client using the default http.Client
func NewWithHTTPClient ¶ added in v0.6.0
NewWithHTTPClient returns a new JSON Client using the specified http.Client
Click to show internal directories.
Click to hide internal directories.