http

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

Types

type AsyncResults

type AsyncResults[T any] struct {
	Data  T
	Error error
	Time  time.Duration
}

type FetchOptions

type FetchOptions struct {
	Method             string               `json:"method"`
	Body               string               `json:"body"`
	Headers            map[string]string    `json:"headers"`
	Redirect           FetchOptionsRedirect `json:"redirects"`
	Follow             int                  `json:"follow"`
	Compress           bool                 `json:"compress"`
	Size               int                  `json:"size"`
	Agent              string               `json:"agent"`
	HighWaterMark      int                  `json:"highWaterMark"`
	InsecureHTTPParser bool                 `json:"insecureHTTPParser"`
}

type FetchOptionsRedirect

type FetchOptionsRedirect string
const (
	Follow FetchOptionsRedirect = "follow"
	Error  FetchOptionsRedirect = "error"
	Manual FetchOptionsRedirect = "manual"
)

type HttpModule

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

func (*HttpModule) Exports

func (hp *HttpModule) Exports() *modules.Exports

func (*HttpModule) FetchAsync

func (hp *HttpModule) FetchAsync(url string, fetchOpts FetchOptions) (*goja.Promise, error)

Jump to

Keyboard shortcuts

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