common

package module
v0.0.0-...-400e319 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2021 License: MPL-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL