http

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DELETE

func DELETE(ctx context.Context, args ...core.Value) (core.Value, error)

DELETE makes a HTTP DELETE request. @param {Object} params - Request parameters. @param {String} params.url - Target url @param {Binary} params.body - Request data @param {Object} [params.headers] - HTTP headers @return {Binary} - Response in binary format

func GET

func GET(ctx context.Context, args ...core.Value) (core.Value, error)

GET makes a HTTP GET request. @param {Object | String} urlOrParam - Target url or parameters. @param {String} [param.url] - Target url or parameters. @param {Object} [param.headers] - HTTP headers @return {Binary} - Response in binary format

func POST

func POST(ctx context.Context, args ...core.Value) (core.Value, error)

POST makes a POST request. @param {Object} params - Request parameters. @param {String} params.url - Target url @param {Binary} params.body - Request data @param {Object} [params.headers] - HTTP headers @return {Binary} - Response in binary format

func PUT

func PUT(ctx context.Context, args ...core.Value) (core.Value, error)

PUT makes a PUT HTTP request. @param {Object} params - Request parameters. @param {String} params.url - Target url @param {Binary} params.body - Request data @param {Object} [params.headers] - HTTP headers @return {Binary} - Response in binary format

func REQUEST

func REQUEST(ctx context.Context, args ...core.Value) (core.Value, error)

REQUEST makes a HTTP request. @param {Object} params - Request parameters. @param {String} params.method - HTTP method @param {String} params.url - Target url @param {Binary} params.body - Request data @param {Object} [params.headers] - HTTP headers @return {Binary} - Response in binary format

func RegisterLib

func RegisterLib(ns core.Namespace) error

RegisterLib register `HTTP` namespace functions. @namespace HTTP

Types

type Params

type Params struct {
	Method  values.String
	URL     values.String
	Headers *values.Object
	Body    values.Binary
}

Jump to

Keyboard shortcuts

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