package
Version:
v0.5.1
Opens a new window with list of versions in this module.
Published: Aug 31, 2021
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
ContentType is the default mime type for JSON
DefaultClient is the singleton instance of jsonclient using http.DefaultClient
ErrorBody returns the request body from an Error
Get fetches url using GET and unmarshals into the passed response using DefaultClient
func Post(url string, request interface{}, response interface{}) error
Post sends request as JSON and unmarshals the response JSON into the supplied struct using DefaultClient
type Client interface {
Get(url string, response interface{}) error
Post(url string, request interface{}, response interface{}) error
ErrorResponse(err error, response interface{}) bool
}
type Error struct {
StatusCode int
Body string
}
Error contains additional http/JSON details
Source Files
¶
Click to show internal directories.
Click to hide internal directories.