request

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClient

func DefaultClient() *http.Client

DefaultClient to use in the scraper

func ExtractHLS added in v1.2.4

func ExtractHLS(URL string, headers map[string]string) (map[string]*static.Stream, error)

ExtractHLS contents of a file/URL into the internal stream structure. If the playlist contains multiple streams then each stream will be represented as a unique stream internally

func Get

func Get(URL string) (string, error)

Get content as string

func GetAsBytes

func GetAsBytes(URL string) ([]byte, error)

GetAsBytes content as string

func GetAsBytesWithHeaders

func GetAsBytesWithHeaders(URL string, headers map[string]string) ([]byte, error)

GetAsBytesWithHeaders content as string

func GetSizeFromHeaders

func GetSizeFromHeaders(headers *http.Header) (int64, error)

GetSizeFromHeaders of http.Response

func GetWithHeaders

func GetWithHeaders(URL string, headers map[string]string) (string, error)

GetWithHeaders content as string

func Headers

func Headers(URL, refer string) (http.Header, error)

Headers return the HTTP Headers of the URL

func ParseHLSMediaStream added in v1.2.4

func ParseHLSMediaStream(mediaStr *string, URL string) ([]*static.URL, []byte, error)

ParseHLSMediaStream into URLs and if found it's key

func PostAsBytes

func PostAsBytes(URL string) ([]byte, error)

PostAsBytes content as string

func PostAsBytesWithHeaders

func PostAsBytesWithHeaders(URL string, headers map[string]string) ([]byte, error)

PostAsBytesWithHeaders content as string

func Request

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

Request http

func Size

func Size(URL, refer string) (int64, error)

Size get size of the URL

Types

type LogRedirects

type LogRedirects struct {
	Transport http.RoundTripper
}

LogRedirects to sanitize "Location" URLs

func (LogRedirects) RoundTrip

func (l LogRedirects) RoundTrip(req *http.Request) (resp *http.Response, err error)

RoundTrip implementation

type Myjar

type Myjar struct {
	Jar map[string][]*http.Cookie
}

Myjar of client

func (*Myjar) Cookies

func (p *Myjar) Cookies(u *url.URL) []*http.Cookie

Cookies of client

func (*Myjar) SetCookies

func (p *Myjar) SetCookies(u *url.URL, cookies []*http.Cookie)

SetCookies of client

Jump to

Keyboard shortcuts

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