http

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP struct{}

func (*HTTP) Batch

func (http *HTTP) Batch(ctx context.Context, reqsV goja.Value) (goja.Value, error)

func (*HTTP) Del

func (http *HTTP) Del(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Get

func (http *HTTP) Get(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Head

func (http *HTTP) Head(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Patch

func (http *HTTP) Patch(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Post

func (http *HTTP) Post(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Put

func (http *HTTP) Put(ctx context.Context, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Request

func (http *HTTP) Request(ctx context.Context, method string, url goja.Value, args ...goja.Value) (*HTTPResponse, error)

func (*HTTP) Url added in v0.16.0

func (http *HTTP) Url(parts []string, pieces ...string) URLTag

type HTTPResponse

type HTTPResponse struct {
	RemoteIP   string
	RemotePort int
	URL        string
	Status     int
	Proto      string
	Headers    map[string]string
	Body       string
	Timings    HTTPResponseTimings
	Error      string
	// contains filtered or unexported fields
}

func (*HTTPResponse) Html

func (res *HTTPResponse) Html(selector ...string) html.Selection

func (*HTTPResponse) Json

func (res *HTTPResponse) Json() goja.Value

type HTTPResponseTimings

type HTTPResponseTimings struct {
	Duration, Blocked, LookingUp, Connecting, Sending, Waiting, Receiving float64
}

type URLTag added in v0.16.0

type URLTag struct {
	URL  string // http://example.com/thing/1234/
	Name string // http://example.com/thing/${}/
}

A URLTag is a special wrapper around a URL that provides the source template for a template URL. Name is assigned as the 'name' tag. Used to group together functionally identical URLs, eg.: for (var i = 0; i < 100; i++) { http.get(url`http://example.com/thing/${id}`) }

Jump to

Keyboard shortcuts

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