fetch

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	cli: http.DefaultClient,
	h: http.Header{
		"Content-Type": []string{"application/json"},
	},
	m: http.MethodGet,
}

Functions

func Fetch

func Fetch(url string, callback func(resp *http.Response) error, o *Options) error

Types

type Options

type Options struct {
	// contains filtered or unexported fields
}

func (*Options) Client

func (o *Options) Client(cli *http.Client) *Options

func (*Options) ContentType

func (o *Options) ContentType(contentTyp string) *Options

func (*Options) Header

func (o *Options) Header(h http.Header) *Options

Jump to

Keyboard shortcuts

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