ihttp

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UA is user agent
	UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.3578.98 Safari/537.36"
)

Functions

func AddHandler

func AddHandler(h context.Handler)

AddHandler for iris

func Delete

func Delete(path string, handlers ...context.Handler)

Delete add del router

func EnableCrossOrigin

func EnableCrossOrigin()

EnableCrossOrigin for client

func Get

func Get(path string, handlers ...context.Handler)

Get add get router

func Handle

func Handle(method string, relativePath string, handlers ...context.Handler)

Handle add router

func HandleDir

func HandleDir(requestPath string, fsOrDir interface{}, opts ...iris.DirOptions) (routes []*router.Route)

HandleDir static dir

func Iris

func Iris() *iris.Application

Iris return the instance

func Post

func Post(path string, handlers ...context.Handler)

Post add post router

func Put

func Put(path string, handlers ...context.Handler)

Put add put router

func Run

func Run(addr string) error

Run the iris app

func SetLogLv

func SetLogLv(lv string)

SetLogLv for iris

func SetLogOutput

func SetLogOutput(w io.Writer)

SetLogOutput for io

Types

type Jar

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

Jar store the cookies

func (*Jar) Cookies

func (jar *Jar) Cookies(u *url.URL) []*http.Cookie

Cookies get all cookies

func (*Jar) SetCookies

func (jar *Jar) SetCookies(u *url.URL, cookies []*http.Cookie)

SetCookies new cookies

type Req

type Req struct {
	http.Client
	// contains filtered or unexported fields
}

Req is http client req

func NewHttpClient

func NewHttpClient(proxyUrl ...string) *Req

NewHttpClient get new client

func (*Req) DoReq

func (req *Req) DoReq(method string, targetUrl string, callback func(*url.URL, io.Reader))

DoReq client request target url

Jump to

Keyboard shortcuts

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