api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAccept                  = "Accept"
	HeaderCacheControl            = "Cache-Control"
	HeaderContentDisposition      = "Content-Disposition"
	HeaderContentEncoding         = "Content-Encoding"
	HeaderContentLanguage         = "Content-Language"
	HeaderContentType             = "Content-Type"
	HeaderAuthorization           = "Authorization"
	HeaderWebsiteRedirectLocation = "Website-Redirect-Location"
)

set of supported api header keys

View Source
const (
	MediaTypeJSON = "application/json"
)

set of supported api media types

Variables

This section is empty.

Functions

func ContentTypeByExtension

func ContentTypeByExtension(ext string) (string, bool)

ContentTypeByExtension returns the content type determined by the file extension

func IncludeQuery

func IncludeQuery(req *http.Request, q map[string]string)

IncludeQuery includes the query with the http request

Types

type ErrUnexpectedStatusCode

type ErrUnexpectedStatusCode struct {
	Action string
	Actual int
}

ErrUnexpectedStatusCode is an unexpected status code error

func (ErrUnexpectedStatusCode) Error

func (err ErrUnexpectedStatusCode) Error() string

type RequestOptions

type RequestOptions struct {
	Body           io.Reader
	ContentType    string
	NoAuth         bool
	PreventRefresh bool
	Query          map[string]string
	RefreshAuth    bool
}

RequestOptions are options to configure an *http.Request

Jump to

Keyboard shortcuts

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