Documentation ¶
Index ¶
- func BasicAuthGet(path, username, password string) ([]byte, int, error)
- func BasicAuthRequest(path, username, password string) (*http.Request, error)
- func Get(path string) ([]byte, int, error)
- func GetRequest(request *http.Request, insecure bool) ([]byte, int, error)
- func Post(payload []byte, path string, headers map[string]string, insecure bool) ([]byte, int, error)
- func ResponseCheck(response *http.Response) ([]byte, int, error)
- func XMLADXBasicAuthPost(path, method, payload, username, password string) ([]byte, int, error)
- func XMLBasicAuthGet(path, username, password string) ([]byte, int, error)
- func XMLErrHandler(w http.ResponseWriter, r *http.Request, resp Response, code int)
- func XMLGet(path string) ([]byte, int, error)
- func XMLGetRequest(request *http.Request) ([]byte, int, error)
- func XMLMarshalHead(r interface{}) string
- func XMLPost(payload []byte, path string, headers map[string]string, insecure bool) ([]byte, int, error)
- func XMLResHandler(w http.ResponseWriter, r *http.Request, resp Response)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthGet ¶
BasicAuthGet adds basic auth and perform a request to path
func BasicAuthRequest ¶
BasicAuthRequest creates a "GET" request with basic auth and return it
func GetRequest ¶
GetRequest executes a request and returns an []byte response, response code, and error
func Post ¶
func Post(payload []byte, path string, headers map[string]string, insecure bool) ([]byte, int, error)
Post will porform a post request with the data provided.
func ResponseCheck ¶
ResponseCheck reads the response and return data, status code or error it encountered.
func XMLADXBasicAuthPost ¶
XMLBasicAuthGet adds basic auth and perform a request to path
func XMLBasicAuthGet ¶
XMLBasicAuthGet adds basic auth and perform a request to path
func XMLErrHandler ¶
returns the resp map as a xml string with the error code provided
func XMLGetRequest ¶
XMLGetRequest performs a get request and sets the application/xml header to accept
func XMLMarshalHead ¶
func XMLMarshalHead(r interface{}) string
XMLWithHeader will take a structure and xml marshal with the <?xml version="1.0" encoding="UTF-8"?> header prepended to the XML request.
func XMLPost ¶
func XMLPost(payload []byte, path string, headers map[string]string, insecure bool) ([]byte, int, error)
XMLPost will porform a post request with the data provided, it will add content-type header xml to the header map.
func XMLResHandler ¶
func XMLResHandler(w http.ResponseWriter, r *http.Request, resp Response)
returns the resp map as a xml string with a 200 OK