httputil

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: LGPL-2.1 Imports: 21 Imported by: 2

Documentation

Overview

Package httputil is simple http decode request wrapper

Package httputil is simple http GET request wrapper

Package httputil is simple http POST request wrapper

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeHTMLBody

func DecodeHTMLBody(body io.Reader) (io.Reader, error)

DecodeHTMLBody returns an decoding reader of the html Body for the specified `charset` If `charset` is empty, DecodeHTMLBody tries to guess the encoding from the content

func GetBytes

func GetBytes(u string, headers http.Header, timeout time.Duration, retryCount int) (c []byte, err error)

GetBytes returns content as []byte

func GetHostByURL

func GetHostByURL(u string) (host string)

GetHostByURL get host by url

func GetPage

func GetPage(url, ua string) (io.Reader, error)

GetPage get HTML page by url

func PostPage

func PostPage(url, key string) (io.Reader, error)

PostPage post to page

func SetInsecureSkipVerify added in v1.0.4

func SetInsecureSkipVerify(b bool)

func SetUserAgent added in v1.0.4

func SetUserAgent(ua string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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