xhr

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enable

func Enable(runtime *goja.Runtime, proxyUrl *url.URL) error

func NewMultipart

func NewMultipart(w io.Writer) *multipartWrapper

Types

type EventProp

type EventProp struct {
	Onload     func(event *ProgressEvent) `json:"onload"`
	Onprogress func(event *ProgressEvent) `json:"onprogress"`
	Onabort    func(event *ProgressEvent) `json:"onabort"`
	Onerror    func(event *ProgressEvent) `json:"onerror"`
	Ontimeout  func(event *ProgressEvent) `json:"ontimeout"`
	// contains filtered or unexported fields
}

func (*EventProp) AddEventListener

func (ep *EventProp) AddEventListener(event string, cb func(event *ProgressEvent))

func (*EventProp) RemoveEventListener

func (ep *EventProp) RemoveEventListener(event string)

type ProgressEvent

type ProgressEvent struct {
	Type             string `json:"type"`
	LengthComputable bool   `json:"lengthComputable"`
	Loaded           int64  `json:"loaded"`
	Total            int64  `json:"total"`
}

type XMLHttpRequest

type XMLHttpRequest struct {
	Upload       *XMLHttpRequestUpload `json:"upload"`
	Timeout      int                   `json:"timeout"`
	ReadyState   int                   `json:"readyState"`
	Status       int                   `json:"status"`
	StatusText   string                `json:"statusText"`
	Response     string                `json:"response"`
	ResponseText string                `json:"responseText"`
	*EventProp
	Onreadystatechange func(event *ProgressEvent) `json:"onreadystatechange"`
	// contains filtered or unexported fields
}

func (*XMLHttpRequest) Abort

func (xhr *XMLHttpRequest) Abort()

func (*XMLHttpRequest) GetAllResponseHeaders

func (xhr *XMLHttpRequest) GetAllResponseHeaders() string

func (*XMLHttpRequest) GetResponseHeader

func (xhr *XMLHttpRequest) GetResponseHeader(key string) string

func (*XMLHttpRequest) Open

func (xhr *XMLHttpRequest) Open(method, url string)

func (*XMLHttpRequest) Send

func (xhr *XMLHttpRequest) Send(data goja.Value)

func (*XMLHttpRequest) SetRequestHeader

func (xhr *XMLHttpRequest) SetRequestHeader(key, value string)

type XMLHttpRequestUpload

type XMLHttpRequestUpload struct {
	*EventProp
}

Jump to

Keyboard shortcuts

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