http

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: AGPL-3.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
	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