request

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ReqSiteConfig = ReadNodeSiteConfig()
)

Functions

func Get

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

func GetByte

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

func PostForm

func PostForm(url string, data urlPkg.Values, headers map[string]string) (string, error)

func PostJson

func PostJson(url string, body []byte, headers map[string]string) (string, error)

func Request

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

Types

type NodeSiteConfig

type NodeSiteConfig = map[string]SiteConfig

func ReadNodeSiteConfig

func ReadNodeSiteConfig() NodeSiteConfig

type SiteConfig

type SiteConfig struct {
	HttpsAgent string            `json:"httpsAgent,omitempty"`
	Headers    map[string]string `json:"headers,omitempty"`
}

Jump to

Keyboard shortcuts

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