http

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseResponse

func ParseResponse(response *http.Response) (string, error)

ParseResponse reads given Response body and return its string type value

Types

type Response

type Response struct {
	Code           int
	Message        string
	ResponseString string
	Headers        http.Header
}

Response holds the processed data from HTTP calls

func Get

func Get(URL string) (Response, error)

Get makes an HTTP call to given URL and returns Response

func GetBasicAuth

func GetBasicAuth(URL string, username string, password string) (Response, error)

GetBasicAuth makes an HTTP call to given URL with basic authentication and returns response.

func GetBasicAuthCustomRetry

func GetBasicAuthCustomRetry(URL string, username string, password string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

GetBasicAuthCustomRetry makes an HTTP call to given URL with basic authentication and returns response. It also retries for failures with given retry count and wait seconds.

func GetBasicAuthRetry

func GetBasicAuthRetry(URL string, username string, password string) (Response, error)

GetBasicAuthRetry makes an HTTP call to given URL with basic authentication and returns response. It also retries for failures.

func GetCustomAuth

func GetCustomAuth(URL string, token string) (Response, error)

GetCustomAuth makes an HTTP call to given URL with custom authentication and returns response.

func GetCustomAuthCustomRetry

func GetCustomAuthCustomRetry(URL string, token string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

GetCustomAuthCustomRetry makes an HTTP call to given URL with custom authentication and returns response. It also retries for failures with given retry count and wait seconds.

func GetCustomAuthRetry

func GetCustomAuthRetry(URL string, token string) (Response, error)

GetCustomAuthRetry makes an HTTP call to given URL with custom authentication and returns response. It also retries for failures.

func GetCustomRetry

func GetCustomRetry(URL string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

GetCustomRetry makes an HTTP call to given URL with custom retry options and returns Response

func GetHeaders

func GetHeaders(URL string, headers map[string]string) (Response, error)

GetHeaders makes an HTTP call to given URL with headers and returns response

func GetHeadersCustomAuth

func GetHeadersCustomAuth(URL string, headers map[string]string, token string) (Response, error)

GetHeadersCustomAuth makes an HTTP call to given URL with headers and custom auth and returns response.

func GetHeadersCustomAuthCustomRetry

func GetHeadersCustomAuthCustomRetry(URL string, headers map[string]string, retryCount int, retryWaitSeconds time.Duration, token string) (Response, error)

GetHeadersCustomAuthCustomRetry makes an HTTP call to given URL with headers and custom auth and returns response. It also retries for failures with given retry count and wait seconds.

func GetHeadersCustomAuthRetry

func GetHeadersCustomAuthRetry(URL string, headers map[string]string, token string) (Response, error)

GetHeadersCustomAuthRetry makes an HTTP call to given URL with headers and custom auth and returns response. It also retries for failures.

func GetHeadersCustomRetry

func GetHeadersCustomRetry(URL string, headers map[string]string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

GetHeadersCustomRetry makes an HTTP call to given URL with headers and returns response. It also retries for failures with given retry count and wait seconds.

func GetHeadersRetry

func GetHeadersRetry(URL string, headers map[string]string) (Response, error)

GetHeadersRetry makes an HTTP call to given URL with headers and returns response. It also retries for failures.

func GetRetry

func GetRetry(URL string) (Response, error)

GetRetry makes an HTTP call to given URL and returns Response

func Post

func Post(URL string, requestBody string) (Response, error)

Post makes an HTTP call to given URL and returns response

func PostBasicAuth

func PostBasicAuth(URL string, requestBody string, username string, password string) (Response, error)

PostBasicAuth makes an HTTP call to given URL with basic authentication and returns response.

func PostBasicAuthCustomRetry

func PostBasicAuthCustomRetry(URL string, requestBody string, username string, password string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PostBasicAuthCustomRetry makes an HTTP call to given URL with basic authentication and returns response. It also retries for failures with given retry count and wait seconds.

func PostBasicAuthRetry

func PostBasicAuthRetry(URL string, requestBody string, username string, password string) (Response, error)

PostBasicAuthRetry makes an HTTP call to given URL with basic authentication and returns response. It also retries for failures.

func PostCustomAuth

func PostCustomAuth(URL string, requestBody string, token string) (Response, error)

PostCustomAuth makes an HTTP call to given URL with custom authentication and returns response.

func PostCustomAuthCustomRetry

func PostCustomAuthCustomRetry(URL string, requestBody string, token string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PostCustomAuthCustomRetry makes an HTTP call to given URL with custom authentication and returns response. It also retries for failures with given retry count and wait seconds.

func PostCustomAuthRetry

func PostCustomAuthRetry(URL string, requestBody string, token string) (Response, error)

PostCustomAuthRetry makes an HTTP call to given URL with custom authentication and returns response. It also retries for failures

func PostHeaders

func PostHeaders(URL string, requestBody string, headers map[string]string) (Response, error)

PostHeaders makes an HTTP call to given URL with headers and returns response

func PostHeadersCustomRetry

func PostHeadersCustomRetry(URL string, requestBody string, headers map[string]string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PostHeadersCustomRetry makes an HTTP call to given URL with headers and returns response. It also retries for failures with given retry count and wait seconds.

func PostHeadersFormDataCustomRetry

func PostHeadersFormDataCustomRetry(URL string, formData map[string]string, headers map[string]string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PostHeadersFormDataCustomRetry makes an HTTP call to given URL with form data, headers and returns response. It also retries for failures with given retry count and wait seconds.

func PostHeadersFormDataRetry

func PostHeadersFormDataRetry(URL string, formData map[string]string, headers map[string]string) (Response, error)

PostHeadersFormDataRetry makes an HTTP call to given URL with form data, headers and returns response. It also retries for failures.

func PostHeadersRetry

func PostHeadersRetry(URL string, requestBody string, headers map[string]string) (Response, error)

PostHeadersRetry makes an HTTP call to given URL with headers and returns response. It also retries for failures.

func Put

func Put(URL string, requestBody string) (Response, error)

Put makes PUT HTTP call to given URL and returns response.

func PutBasicAuth

func PutBasicAuth(URL string, requestBody string, username string, password string) (Response, error)

PutBasicAuth makes an HTTP call to given URL with basic authentication and returns response.

func PutBasicAuthCustomRetry

func PutBasicAuthCustomRetry(URL string, requestBody string, username string, password string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PutBasicAuthCustomRetry makes an HTTP call to given URL with basic authentication and returns response. It also retries for failures with given retry count and wait seconds.

func PutBasicAuthRetry

func PutBasicAuthRetry(URL string, requestBody string, username string, password string) (Response, error)

PutBasicAuthRetry makes an HTTP call to given URL with basic authentication and returns response. It also retries for failures.

func PutCustomAuth

func PutCustomAuth(URL string, requestBody string, token string) (Response, error)

PutCustomAuth makes an HTTP call to given URL with custom authentication and returns response.

func PutCustomAuthCustomRetry

func PutCustomAuthCustomRetry(URL string, requestBody string, token string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PutCustomAuthCustomRetry makes an HTTP call to given URL with custom authentication and returns response. It also retries for failures with given retry count and wait seconds.

func PutCustomAuthRetry

func PutCustomAuthRetry(URL string, requestBody string, token string) (Response, error)

PutCustomAuthRetry makes an HTTP call to given URL with custom authentication and returns response. It also retries for failures.

func PutHeaders

func PutHeaders(URL string, requestBody string, headers map[string]string) (Response, error)

PutHeaders makes PUT HTTP call to given URL with headers and returns response.

func PutHeadersCustomRetry

func PutHeadersCustomRetry(URL string, requestBody string, headers map[string]string, retryCount int, retryWaitSeconds time.Duration) (Response, error)

PutHeadersCustomRetry makes PUT HTTP call to given URL with headers and returns response. It also retries for failures with given retry count and wait seconds.

func PutHeadersRetry

func PutHeadersRetry(URL string, requestBody string, headers map[string]string) (Response, error)

PutHeadersRetry makes PUT HTTP call to given URL with headers and returns response. It also retries for failures.

Jump to

Keyboard shortcuts

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