httpjs

package
v0.0.0-...-7b70c5d Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBuilder = func(r *goja.Runtime, req *Request) *goja.Object {
	obj := r.NewObject()
	obj.Set("GetID", req.GetID)
	obj.Set("GetURL", req.GetURL)
	obj.Set("SetURL", req.SetURL)
	obj.Set("GetProxy", req.GetProxy)
	obj.Set("SetProxy", req.SetProxy)
	obj.Set("GetMethod", req.GetMethod)
	obj.Set("SetMethod", req.SetMethod)
	obj.Set("GetBody", req.GetBody)
	obj.Set("GetBodyArrayBuffer", req.GetBodyArrayBuffer)
	obj.Set("SetBody", req.SetBody)
	obj.Set("FinishedAt", req.FinishedAt)
	obj.Set("ExecuteStatus", req.ExecuteStatus)
	obj.Set("ResetHeader", req.ResetHeader)
	obj.Set("SetHeader", req.SetHeader)
	obj.Set("AddHeader", req.AddHeader)
	obj.Set("DelHeader", req.DelHeader)
	obj.Set("GetHeader", req.GetHeader)
	obj.Set("HeaderValues", req.HeaderValues)
	obj.Set("HeaderFields", req.HeaderFields)
	obj.Set("ResponseStatusCode", req.ResponseStatusCode)
	obj.Set("ResponseBody", req.ResponseBody)
	obj.Set("ResponseBodyArrayBuffer", req.ResponseBodyArrayBuffer)
	obj.Set("ResponseHeader", req.ResponseHeader)
	obj.Set("ResponseHeaderValues", req.ResponseHeaderValues)
	obj.Set("ResponseHeaderFields", req.ResponseHeaderFields)
	obj.Set("Execute", req.Execute)
	return obj
}

Functions

This section is empty.

Types

type Addon

type Addon struct {
	Addon   *httpaddon.Addon
	Builder Builder
}

func Create

func Create(p herbplugin.Plugin) *Addon

func (*Addon) Convert

func (a *Addon) Convert(r *goja.Runtime) *goja.Object

func (*Addon) NewRequest

func (a *Addon) NewRequest(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Addon) ParseURL

func (a *Addon) ParseURL(call goja.FunctionCall, r *goja.Runtime) goja.Value

type Builder

type Builder func(r *goja.Runtime, req *Request) *goja.Object

type Request

type Request struct {
	Request *httpaddon.Request
}

func (*Request) AddHeader

func (req *Request) AddHeader(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) DelHeader

func (req *Request) DelHeader(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) Execute

func (req *Request) Execute(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ExecuteStatus

func (req *Request) ExecuteStatus(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) FinishedAt

func (req *Request) FinishedAt(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetBody

func (req *Request) GetBody(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetBodyArrayBuffer

func (req *Request) GetBodyArrayBuffer(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetHeader

func (req *Request) GetHeader(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetID

func (req *Request) GetID(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetMethod

func (req *Request) GetMethod(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetProxy

func (req *Request) GetProxy(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) GetURL

func (req *Request) GetURL(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) HeaderFields

func (req *Request) HeaderFields(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) HeaderValues

func (req *Request) HeaderValues(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResetHeader

func (req *Request) ResetHeader(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResponseBody

func (req *Request) ResponseBody(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResponseBodyArrayBuffer

func (req *Request) ResponseBodyArrayBuffer(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResponseHeader

func (req *Request) ResponseHeader(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResponseHeaderFields

func (req *Request) ResponseHeaderFields(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResponseHeaderValues

func (req *Request) ResponseHeaderValues(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) ResponseStatusCode

func (req *Request) ResponseStatusCode(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) SetBody

func (req *Request) SetBody(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) SetBodyArrayBuffer

func (req *Request) SetBodyArrayBuffer(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) SetHeader

func (req *Request) SetHeader(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) SetMethod

func (req *Request) SetMethod(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) SetProxy

func (req *Request) SetProxy(call goja.FunctionCall, r *goja.Runtime) goja.Value

func (*Request) SetURL

func (req *Request) SetURL(call goja.FunctionCall, r *goja.Runtime) goja.Value

Jump to

Keyboard shortcuts

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