download

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2022 Hal Canary Use of this program is governed by the file LICENSE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v0.1.1

func Get(client *http.Client, requestUrl, referer, userAgent string) (io.ReadCloser, string, error)

Call `client.Do(http.NewRequest())`, but with extra steps. Set `User-Agent` and `Referer` (if set). If Error status code is returned, close body and return `error`.

func GetUrl

func GetUrl(url, ref string, force bool) (io.ReadCloser, error)

Fetch the content of a URL, using a cache if possible and if force is false.

func Post added in v0.1.1

func Post(client *http.Client, data url.Values, requestUrl, referer, userAgent string) (io.ReadCloser, string, error)

Call `client.Do(http.NewRequest())`, but with extra steps. Make sure `Content-Type` is `application/x-www-form-urlencoded` Set `User-Agent` and `Referer` (if set). If Error status code is returned, close body and return `error`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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