vhttp

package
v0.0.0-...-ebd5e3c Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClient

func CreateClient() *http.Client

func Get

func Get(url string) (response *http.Response, err error)

Get Send GET request

func IsOK

func IsOK(resp *http.Response) bool

func IsURL

func IsURL(rawUrl string) bool

func Post

func Post(url string, data interface{}, contentType string) (response *http.Response, err error)

Post Send POST request

Types

type Domain

type Domain struct {
	DomainName string
	SubDomain  string
}

func CheckExtractDomain

func CheckExtractDomain(domain string) (*Domain, error)

CheckExtractDomain 提取顶级主域名跟域名记录 example: www.baidu.com -> 顶级域名:baidu.com 记录:www a.b.baidu.com -> 顶级域名:baidu.com 记录:a.b

type HttpMethod

type HttpMethod string
const (
	HttpMethodGet     HttpMethod = "GET"
	HttpMethodPut     HttpMethod = "PUT"
	HttpMethodHead    HttpMethod = "HEAD"
	HttpMethodOptions HttpMethod = "OPTIONS"
	HttpMethodDelete  HttpMethod = "DELETE"
	HttpMethodPost    HttpMethod = "POST"
	HttpMethodTrace   HttpMethod = "TRACE"
	HttpMethodConnect HttpMethod = "CONNECT"
)

func (HttpMethod) String

func (receiver HttpMethod) String() string

Jump to

Keyboard shortcuts

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