request

package
v0.0.0-...-7d5947c Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequest

type APIRequest struct {
	// contains filtered or unexported fields
}

func (*APIRequest) Execute

func (request *APIRequest) Execute() (*APIResponse, error)

type APIRequestBuilder

type APIRequestBuilder struct {
	// contains filtered or unexported fields
}

func NewAPIRequestBuilder

func NewAPIRequestBuilder(baseUrl string, options ...APIRequestOption) (*APIRequestBuilder, error)

func (*APIRequestBuilder) Build

func (builder *APIRequestBuilder) Build() *APIRequest

func (*APIRequestBuilder) WithHeader

func (opts *APIRequestBuilder) WithHeader(key, value string)

func (*APIRequestBuilder) WithQuery

func (opts *APIRequestBuilder) WithQuery(params map[string]string)

type APIRequestOption

type APIRequestOption func(*APIRequest)

func WithAccept

func WithAccept(value string) APIRequestOption

func WithAuthorizationBearer

func WithAuthorizationBearer(token string) APIRequestOption

func WithBody

func WithBody(body interface{}) APIRequestOption

func WithContentType

func WithContentType(value string) APIRequestOption

func WithContentTypeJson

func WithContentTypeJson() APIRequestOption

func WithDebug

func WithDebug() APIRequestOption

func WithForceHttp11

func WithForceHttp11() APIRequestOption

func WithHeader

func WithHeader(key, value string) APIRequestOption

func WithMethod

func WithMethod(method string) APIRequestOption

func WithMethodDelete

func WithMethodDelete() APIRequestOption

func WithMethodGet

func WithMethodGet() APIRequestOption

func WithMethodPost

func WithMethodPost() APIRequestOption

func WithMethodPut

func WithMethodPut() APIRequestOption

func WithPath

func WithPath(path string) APIRequestOption

func WithQuery

func WithQuery(params map[string]string) APIRequestOption

type APIResponse

type APIResponse struct {
	InnerResponse *http.Response
	Data          []byte
}

func (*APIResponse) String

func (resp *APIResponse) String() string

func (*APIResponse) UnmarshalJSONTo

func (resp *APIResponse) UnmarshalJSONTo(target interface{}) error

Jump to

Keyboard shortcuts

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