send

package
v0.0.0-...-1259547 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptForm

func AcceptForm() http.Arrow

AcceptForm is syntax sugar of Header("Accept").Is("application/x-www-form-urlencoded")

func AcceptJSON

func AcceptJSON() http.Arrow

AcceptJSON is syntax sugar of Header("Accept").Is("application/json")

func ContentForm

func ContentForm() http.Arrow

ContentForm is syntax sugar of Header("Content-Type").Is("application/x-www-form-urlencoded")

func ContentJSON

func ContentJSON() http.Arrow

ContentJSON is syntax sugar of Header("Content-Type").Is("application/json")

func DELETE

func DELETE(uri string, args ...interface{}) http.Arrow

DELETE is syntax sugar of URL("DELETE", ...)

func GET

func GET(uri string, args ...interface{}) http.Arrow

GET is syntax sugar of URL("GET", ...)

func KeepAlive

func KeepAlive() http.Arrow

KeepAlive is a syntax sugar of Header("Connection").Is("keep-alive")

func POST

func POST(uri string, args ...interface{}) http.Arrow

POST is syntax sugar of URL("POST", ...)

func PUT

func PUT(uri string, args ...interface{}) http.Arrow

PUT is syntax sugar of URL("PUT", ...)

func Params

func Params(query interface{}) http.Arrow

Params appends query params to request URL. The arrow takes a struct and converts it to map[string]string. The function fails if input is not convertable to map of strings (e.g. nested struct).

func Send

func Send(data interface{}) http.Arrow

Send payload to destination URL. You can also use native Go data types (e.g. maps, struct, etc) as egress payload. The library implicitly encodes input structures to binary using Content-Type as a hint. The function fails if content type is not supported by the library.

func URL

func URL(method, uri string, args ...interface{}) http.Arrow

URL defines a mandatory parameters to the request such as HTTP method and destination URL, use Params arrow if you need to supply URL query params.

Types

type THeader

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

THeader is tagged string, represents HTTP Header

func Accept

func Accept() THeader

Accept is syntax sugar of Header("Accept")

func Authorization

func Authorization() THeader

Authorization is syntax sugar of Header("Authorization")

func Content

func Content() THeader

Content is syntax sugar of Header("Content-Type")

func Header(header string) THeader

Header defines HTTP headers to the request, use combinator to define multiple header values.

  http.HTTP(
		ø.Header("Accept").Is(...),
		ø.Header("Content-Type").Is(...),
	)

func (THeader) Is

func (header THeader) Is(value string) http.Arrow

Is sets a literval value of HTTP header

func (THeader) Val

func (header THeader) Val(value *string) http.Arrow

Val sets a value of HTTP header from variable

Jump to

Keyboard shortcuts

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