http

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET     = "GET"
	PUT     = "PUT"
	POST    = "POST"
	DELETE  = "DELETE"
	HEAD    = "HEAD"
	OPTIONS = "OPTIONS"
	PATCH   = "PATCH"
)

Constants of the supported HTTP methods for paddleFlow

Variables

This section is empty.

Functions

func InitClient

func InitClient()

Types

type Request

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

func (*Request) Body

func (r *Request) Body() io.ReadCloser

func (*Request) GenerateUrl

func (r *Request) GenerateUrl() string

func (*Request) Header

func (r *Request) Header(key string) string

func (*Request) Headers

func (r *Request) Headers() map[string]string

func (*Request) Host

func (r *Request) Host() string

func (*Request) Method

func (r *Request) Method() string

func (*Request) Param

func (r *Request) Param(key string) []string

func (*Request) Params

func (r *Request) Params() map[string][]string

func (*Request) Port

func (r *Request) Port() int

func (*Request) QueryString

func (r *Request) QueryString() string

func (*Request) SetBody

func (r *Request) SetBody(stream io.ReadCloser)

func (*Request) SetHeader

func (r *Request) SetHeader(key, value string)

func (*Request) SetHeaders

func (r *Request) SetHeaders(headers map[string]string)

func (*Request) SetHost

func (r *Request) SetHost(host string)

func (*Request) SetMethod

func (r *Request) SetMethod(method string)

func (*Request) SetParam

func (r *Request) SetParam(key, value string)

func (*Request) SetParams

func (r *Request) SetParams(params map[string][]string)

func (*Request) SetPort

func (r *Request) SetPort(port int)

func (*Request) SetTimeout

func (r *Request) SetTimeout(timeout int)

func (*Request) SetUri

func (r *Request) SetUri(uri string)

func (*Request) String

func (r *Request) String() string

func (*Request) Timeout

func (r *Request) Timeout() int

func (*Request) Uri

func (r *Request) Uri() string

type Response

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

func Execute

func Execute(request *Request) (*Response, error)

Execute - do the http requset and get the response

PARAMS:

  • request: the http request instance to be sent

RETURNS:

  • response: the http response returned from the server
  • error: nil if ok otherwise the specific error

func (*Response) Body

func (r *Response) Body() io.ReadCloser

func (*Response) ContentLength

func (r *Response) ContentLength() int64

func (*Response) ElapsedTime

func (r *Response) ElapsedTime() time.Duration

func (*Response) GetHeader

func (r *Response) GetHeader(name string) string

func (*Response) GetHeaders

func (r *Response) GetHeaders() map[string]string

func (*Response) HttpResponse

func (r *Response) HttpResponse() *http.Response

func (*Response) Protocol

func (r *Response) Protocol() string

func (*Response) SetHttpResponse

func (r *Response) SetHttpResponse(response *http.Response)

func (*Response) StatusCode

func (r *Response) StatusCode() int

func (*Response) StatusText

func (r *Response) StatusText() string

Jump to

Keyboard shortcuts

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