httpx

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Header(headers http.Header) string

func NewSession

func NewSession()

func ValidateProxyURL

func ValidateProxyURL(proxy string) (string, error)

Types

type Param

type Param struct {
	// Name of the posted parameter.
	Name string `json:"name"`
	// Value of the posted parameter.
	Value string `json:"value,omitempty"`
	// Filename of a posted file.
	Filename string `json:"fileName,omitempty"`
	// ContentType is the content type of posted file.
	ContentType string `json:"contentType,omitempty"`

	FileHeader   textproto.MIMEHeader
	FileSize     int64
	FileContent  []byte
	IsFile       bool
	Boundary     string
	FilenotFound bool
	IsBase64     bool
	Index        int //
}

Param describes an individual posted parameter.

type RawRequest

type RawRequest struct {
	FullURL        string
	Method         string
	Path           string
	Data           string
	Headers        map[string]string
	UnsafeHeaders  client.Headers
	UnsafeRawBytes []byte
}

RawRequest defines a basic HTTP raw request

func Parse

func Parse(request string, inputURL *urlutil.URL, unsafe bool) (*RawRequest, error)

Parse parses the raw request as supplied by the user

type Response

type Response struct {
	Status           string
	StatusCode       int
	Body             string
	RequestDump      string
	ResponseDump     string
	Header           http.Header
	ContentLength    int
	RequestUrl       string
	Location         string
	ServerDurationMs float64 // 服务器响应时间
}

func Get

func Get(target string) (*Response, error)

func Raw

func Raw(request string, target string) (*Response, error)

Raw 通过 raw 格式直接直接请求 todo 现在修改 host 对应的值,并不会改变

func Request

func Request(target string, method string, postdata string, isredirect bool, headers map[string]string) (*Response, error)

func RequestRaw

func RequestRaw(target string, method string, postdata string, isredirect bool, headers map[string]string) (*Response, error)

func UploadRequest

func UploadRequest(target string, params map[string]string, name, path string) (*Response, error)

UploadRequest 新建上传请求

type Session

type Session struct {
	// Client is the current http client
	Client *http.Client
	// Rate limit instance
	RateLimiter ratelimit.Limiter // 每秒请求速率限制
}

type Variations

type Variations struct {
	// MimeType is the MIME type of the posted data.
	MimeType string `json:"mimeType"`
	// Params is a list of posted parameters (in case of URL encoded parameters).
	Params []Param `json:"params"`
	// OriginalParams 存储原始的值
	OriginalParams []Param `json:"params"`
	// Text contains the posted data. Although its type is string, it may contain
	// binary data.
	Text string `json:"text"`
}

func ParseUri

func ParseUri(uri string, body []byte, method string, contentType string, headers map[string]string) (*Variations, error)

ParseUri 对请求进行格式化

func (Variations) Len

func (p Variations) Len() int

func (Variations) Less

func (p Variations) Less(i, j int) bool

Less 顺序有低到高排序

func (*Variations) Release

func (p *Variations) Release() string

func (Variations) Set

func (p Variations) Set(key string, value string) error

func (*Variations) SetPayload

func (p *Variations) SetPayload(uri string, payload string, method string, key ...[]string) []string

func (*Variations) SetPayloadByIndex

func (p *Variations) SetPayloadByIndex(index int, uri string, payload string, method string) string

SetPayloadByIndex 根据索引设置payload

GET 返回 http://testphp.vulnweb.com/listproducts.php?artist=((,”"(,"","((

POST 返回 artist=')”,)'(())')(

func (Variations) Swap

func (p Variations) Swap(i, j int)

Jump to

Keyboard shortcuts

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