httpx

package
v0.3.37 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationJson = "application/json"
	ContentEncoding = "Content-Encoding"
	ContentSecurity = "X-Content-Security"
	ContentType     = "Content-Type"
	KeyField        = "key"
	SecretField     = "secret"
	TypeField       = "type"
	CryptionType    = 1
)
View Source
const (
	CodeSignaturePass = iota
	CodeSignatureInvalidHeader
	CodeSignatureWrongTime
	CodeSignatureInvalidToken
)
View Source
const MIMEOctetStream = "application/octet-stream"

Variables

This section is empty.

Functions

func CheckMobileAgent

func CheckMobileAgent(agent string) (isMobile bool)

func ClientSelfGet

func ClientSelfGet(client *http.Client, url string) (string, error)

func ClientSelfPost

func ClientSelfPost(client *http.Client, url string, jsonData string) (string, error)

func Client_Get

func Client_Get(url string) (string, int, error)

func Client_Post

func Client_Post(url, jsonData string, session string) (string, error)

func Client_Post_Time

func Client_Post_Time(url string, jsonData string, timeout time.Duration) (string, error)

func Client_Put

func Client_Put(url string, jsonData string) (string, error)

func CutoffHTMLByPercentage

func CutoffHTMLByPercentage(content string, percentage float64) (string, error)

func ExtToContentType

func ExtToContentType(extName string) string

func GetContenAbstract

func GetContenAbstract(content string) (abstract string)

func GetHtmlAbstract

func GetHtmlAbstract(content string) (abstract string)

func GetHtmlContent

func GetHtmlContent(content string) (abstract string)

func GetMIME

func GetMIME(extension string) (mime string)

GetMIME returns the content-type of a file extension

func GetRemoteAddr

func GetRemoteAddr(r *http.Request) string

Returns the peer address, supports X-Forward-For

func GetURLFromContent

func GetURLFromContent(content string) string

func MarkdownAutoNewline

func MarkdownAutoNewline(str string) string

func MarkdownRenderer

func MarkdownRenderer(content string) string

func ParseContentByImg

func ParseContentByImg(valueHtml string) ([]string, error)

func StatusMessage

func StatusMessage(status int) string

StatusMessage returns the correct message for the provided HTTP statuscode

func TrimHtml

func TrimHtml(src string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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