Documentation
¶
Index ¶
Constants ¶
View Source
const JSONApplicationType = "application/json"
JSONApplicationType is the MIME type for JSON requests/responses
Variables ¶
This section is empty.
Functions ¶
func DoJSONRequest ¶
func DoJSONRequest(method string, url string, requestBody interface{}, responseBody interface{}) error
DoJSONRequest sends a client JSON request. The responseBody should be a pointer to the address of a struct. If a blank string is passed then it will default to a POST request. Example:
var response exampleStruct
if err := DoJSONRequest("POST", "http://example.com", nil, &response),
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.