models

package
v0.0.0-...-e91c11c Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestMethodGet  = "GET"
	RequestMethodPost = "POST"
)

Variables

This section is empty.

Functions

func GetRequestRaw

func GetRequestRaw(req *http.Request) (string, error)

func InitialClient

func InitialClient(timeout int, proxy string, redirect bool) (*http.Client, error)

Types

type Cookie struct {
	Key   string
	Value string
}

type Headers

type Headers struct {
	Key   string
	Value string
}

type Request

type Request struct {
	Method  string
	Url     string
	BaseURL string
	Headers map[string]string
	Data    []byte
	Cookie  string
	Timeout time.Duration

	Client *http.Client
	Proxy  string

	RequestRaw string
}

func (*Request) DoReq

func (req *Request) DoReq() (*Response, error)

func (*Request) PrepareRequest

func (req *Request) PrepareRequest() *http.Request

type Response

type Response struct {
	MetaResponse http.Response
	StatusCode   int
	Headers      http.Header
	Body         []byte
}

Jump to

Keyboard shortcuts

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