httpclient

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOAuthToken

func GetOAuthToken(tokenURL string, form url.Values) (map[string]string, error)

GetOAuthToken - Gets a token from OAuth2 endpoint

Types

type HTTPClient

type HTTPClient interface {
	Delete() ([]byte, error)
	Get() ([]byte, error)
	Patch(body io.Reader) ([]byte, error)
	Post(body io.Reader) ([]byte, error)
	PostDicom(fieldName string, fileName string, content io.Reader) ([]byte, error)
	PostMulti(fieldName string, fileName string, content io.Reader) ([]byte, error)
	PostMultiContent(fieldName string, fileName string, contentType string, content io.Reader) ([]byte, error)
	Put(body io.Reader) ([]byte, error)
}

HTTPClient interface

func NewHTTPClient

func NewHTTPClient(params HTTPParams) HTTPClient

NewHTTPClient returns a new http client

type HTTPParams

type HTTPParams struct {
	URL                 string
	Proxy               string
	Timeout             int64
	URLAccessToken      string
	ContentType         string
	AcceptType          string
	DisableCompression  bool
	AuthorizationBearer string
	AuthorizationKey    string
	AuthorizationToken  string
	BasicAuthUser       string
	BasicAuthPass       string
	Headers             map[string]string
	Queries             map[string]string
}

HTTPParams are connection parameters

Jump to

Keyboard shortcuts

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