https

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2021 Murray Inc. All Rights Reserved.

2021/10/18 11:17, by m18527, create ----------------------------------- Http请求方法封装

Copyright 2021 Murray Inc. All Rights Reserved.

2021/12/02 16:27, by m18527, create -----------------------------------

Index

Constants

This section is empty.

Variables

View Source
var (
	// 全局变量
	GlobalCookieJar *cookiejar.Jar
	Header          http.Header
)

Functions

func HttpBaseCommon added in v1.0.8

func HttpBaseCommon(method, username, password, url, payload string, header map[string]string) ([]byte, int, error)

Common

func HttpBasicDelete

func HttpBasicDelete(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Delete

func HttpBasicGet

func HttpBasicGet(username, password, url string, header map[string]string) (bodyBytes []byte, statusCode int)

Get

func HttpBasicPost

func HttpBasicPost(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Post

func HttpBasicPut

func HttpBasicPut(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Put

func HttpCommon

func HttpCommon(method, url, payload string, header map[string]string) ([]byte, int, error)

func HttpDelete

func HttpDelete(url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Delete

func HttpDigestCommon added in v1.0.8

func HttpDigestCommon(method, username, password, url, payload string, header map[string]string) ([]byte, int, error)

func HttpDigestDelete

func HttpDigestDelete(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Delete

func HttpDigestGet

func HttpDigestGet(username, password, url string, header map[string]string) (bodyBytes []byte, statusCode int)

Get

func HttpDigestPost

func HttpDigestPost(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Post

func HttpDigestPut

func HttpDigestPut(username, password, url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Put

func HttpGet

func HttpGet(url string, header map[string]string) (bodyBytes []byte, statusCode int)

Get

func HttpPost

func HttpPost(url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Post

func HttpPut

func HttpPut(url, payload string, header map[string]string) (bodyBytes []byte, statusCode int)

Put

func InitHttp

func InitHttp()

初始化HTTP客户端(示例,未生效)

func NewHttpClient

func NewHttpClient() *http.Client

初始化http客户端

func NewRequest

func NewRequest(method, url string, body io.Reader) (*http.Request, error)

http客户端

func UserAgent

func UserAgent() string

随机UserAgent

func UserAgentChrome

func UserAgentChrome() string

Chrome随机UserAgent

func UserAgentFirefox

func UserAgentFirefox() string

Firefox随机UserAgent

func UserAgentIE

func UserAgentIE() string

IE随机UserAgent

func UserAgentOpera

func UserAgentOpera() string

Opera随机UserAgent

func UserAgentSafari

func UserAgentSafari() string

Safari随机UserAgent

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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