requests

package module
v0.0.0-...-574e0c6 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: GPL-3.0 Imports: 22 Imported by: 0

README

Requests

Go Report Card CodeFactor

安装

go get github.com/sari3l/go-requests

链接

Licenses

MIT License

Documentation

Index

Constants

View Source
const DefaultTimeout = 5 // time.Second
View Source
const Version = "v1.0.0"

Variables

This section is empty.

Functions

func PrepareRequest

func PrepareRequest(method string, url string, params ext.Dict, headers ext.Dict, cookies ext.Dict, data ext.Dict, json map[string]interface{}, files ext.Dict, stream io.Reader, auth ext.AuthInter, hooks ext.HooksDict) (error, *prepareRequest)

func Session

func Session(timeout int, proxy string, redirect bool, verify bool) *session

Types

type Request

type Request struct {
	*http.Request
}

type Response

type Response struct {
	*http.Response

	Ok      bool
	Raw     []byte
	Content string
	History []*Response
	Time    int64
	// contains filtered or unexported fields
}

func Delete

func Delete(url string, ext ...ext.Ext) *Response

func Get

func Get(url string, ext ...ext.Ext) *Response
func Head(url string, ext ...ext.Ext) *Response

func Options

func Options(url string, ext ...ext.Ext) *Response

func Post

func Post(url string, ext ...ext.Ext) *Response

func Put

func Put(url string, ext ...ext.Ext) *Response

func (*Response) ContentType

func (resp *Response) ContentType() string

func (*Response) Json

func (resp *Response) Json() gjson.Result

func (*Response) Save

func (resp *Response) Save(filename string) error

func (*Response) Text

func (resp *Response) Text() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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