internal

package
v0.4.19 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION         = "0.4.19"
	REPOSITORY_LINK = "https://github.com/algrvvv/http"
)

Variables

View Source
var (
	AllHeaders  = flag.BoolP("all-headers", "A", false, "show all headers")
	WithoutBody = flag.BoolP("without-body", "W", false, "dont show request body")
)

Functions

This section is empty.

Types

type InvalidFlagOrOption

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

func (InvalidFlagOrOption) Error

func (e InvalidFlagOrOption) Error() string

type MissingFlagOrOption

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

func (MissingFlagOrOption) Error

func (e MissingFlagOrOption) Error() string

type Request

type Request struct {
	Method    string        // метод запроса
	URL       string        // линк для запроса
	Body      []byte        // тело запроса
	Headers   string        // заголовки
	UserAgent string        // юзер агент
	Cookies   string        // куки
	Proxy     string        // TODO прокси
	Timeout   time.Duration // время выделенное на запрос
	Redirect  bool          // Следовать ли за редиректами
}

func ParseAndGetRequest

func ParseAndGetRequest() (Request, error)

func (Request) MakeRequest

func (r Request) MakeRequest() (Response, error)

type Response

type Response struct {
	Protocol     string        // протокол
	Code         int           // код ответа
	Status       string        // статус ответа
	FinalLink    string        // итоговая ссылка, на которой оставновился запрос
	RedirectLink string        // ссылка переадресации, если есть
	Header       http.Header   // заголовки
	Body         []byte        // тело ответа
	TimeLoad     time.Duration // время ответа
}

func (*Response) FormatOutput

func (r *Response) FormatOutput()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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