http

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupTransport

func SetupTransport(proxyUrl string)

Types

type Request

type Request struct {
	Method          string
	RequestUri      string
	Path            string
	Query           string
	ProtocolVersion string
	Headers         map[string]string
	Cookies         map[string]string
	Body            []byte
}

func Parse

func Parse(bs []byte) Request

func ParseHar added in v0.2.0

func ParseHar(data []byte, target string) []Request

func (Request) Clone

func (r Request) Clone() Request

func (Request) HasFormUrlEncodedBody

func (r Request) HasFormUrlEncodedBody() bool

func (Request) HasJsonBody

func (r Request) HasJsonBody() bool

func (Request) HasJsonCookie added in v0.3.0

func (r Request) HasJsonCookie(key string) bool

func (Request) HasMultipartFormBody

func (r Request) HasMultipartFormBody() bool

func (Request) Raw

func (r Request) Raw(host string) []byte

func (Request) Send

func (r Request) Send(host string) (Response, error)

func (Request) WithBody

func (r Request) WithBody(body []byte) Request

func (Request) WithCookie

func (r Request) WithCookie(key, val string) Request

func (Request) WithCookieString added in v0.3.0

func (r Request) WithCookieString(val string) Request

func (Request) WithHeader

func (r Request) WithHeader(key, val string) Request

func (Request) WithHeaderString added in v0.3.0

func (r Request) WithHeaderString(header string) Request

func (Request) WithPath

func (r Request) WithPath(path string) Request

func (Request) WithQuery

func (r Request) WithQuery(query string) Request

type Response

type Response struct {
	Code   int
	Length int64
	Raw    []byte
}

func (Response) String

func (res Response) String() string

Jump to

Keyboard shortcuts

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