soap

package
v0.0.0-...-500eaca Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuthGet

func BasicAuthGet(path, username, password string) ([]byte, int, error)

BasicAuthGet adds basic auth and perform a request to path

func BasicAuthRequest

func BasicAuthRequest(path, username, password string) (*http.Request, error)

BasicAuthRequest creates a "GET" request with basic auth and return it

func Get

func Get(path string) ([]byte, int, error)

Get makes a GET request to path

func GetRequest

func GetRequest(request *http.Request, insecure bool) ([]byte, int, error)

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

func ResponseCheck(response *http.Response) ([]byte, int, error)

ResponseCheck reads the response and return data, status code or error it encountered.

func XMLADXBasicAuthPost

func XMLADXBasicAuthPost(path, method, payload, username, password string) ([]byte, int, error)

XMLBasicAuthGet adds basic auth and perform a request to path

func XMLBasicAuthGet

func XMLBasicAuthGet(path, username, password string) ([]byte, int, error)

XMLBasicAuthGet adds basic auth and perform a request to path

func XMLErrHandler

func XMLErrHandler(w http.ResponseWriter, r *http.Request, resp Response, code int)

returns the resp map as a xml string with the error code provided

func XMLGet

func XMLGet(path string) ([]byte, int, error)

XMLGet performs a "GET" request to the path and appends the application/xml

func XMLGetRequest

func XMLGetRequest(request *http.Request) ([]byte, int, error)

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

Types

type Response

type Response map[string]interface{}

generic response writter for APIs

func (Response) String

func (r Response) String() string

This method returns a json marshaled response

func (Response) XML

func (r Response) XML() string

This method returns a xml marshaled response

Jump to

Keyboard shortcuts

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