request

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentType

func ContentType(url, refer string) (string, error)

ContentType get Content-Type of the url

func Get

func Get(url, refer string, headers map[string]string) (string, error)

Get get request

func GetByte

func GetByte(url, refer string, headers map[string]string) ([]byte, error)

GetByte get request

func Headers

func Headers(url, refer string) (http.Header, error)

Headers return the HTTP Headers of the url

func Request

func Request(method, url string, body io.Reader, headers map[string]string) (*http.Response, error)

Request base request

func SetOptions

func SetOptions(opt Options)

SetOptions sets the common request option.

func Size

func Size(url, refer string) (int64, error)

Size get size of the url

Types

type Options

type Options struct {
	RetryTimes int
	Cookie     string
	UserAgent  string
	Refer      string
	Debug      bool
	Silent     bool
}

Options defines common request options.

Jump to

Keyboard shortcuts

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