http

package
v0.0.0-...-89b6d9c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, url string) (resp *http.Response, err error)

Get calls http.Get with expected http User-Agent

func Init

func Init()

Init sets the User-Agent for all subsequent requests

func NewRequest

func NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error)

NewRequest calls http.NewRequest with expected http User-Agent

func Post

func Post(ctx context.Context, url, contentType string, body io.Reader) (resp *http.Response, err error)

Post calls http.Post with expected http User-Agent

Types

type Transport

type Transport struct {
}

Transport adds the expected http User-Agent to any request

func (*Transport) RoundTrip

func (*Transport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes the default http.Transport with expected http User-Agent

Jump to

Keyboard shortcuts

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