webapi: github.com/gowebapi/webapi/communication/xhr Index | Examples | Files

package xhr

import "github.com/gowebapi/webapi/communication/xhr"

Package xhr contains XMLHttpRequest Standard that provides scripted client functionality for transferring data between a client and a server.

Index

Examples

Package Files

doc.go xhr.go

Constants

const (
    UNSENT           int = 0
    OPENED           int = 1
    HEADERS_RECEIVED int = 2
    LOADING          int = 3
    DONE             int = 4
)

type ProgressEvent Uses

type ProgressEvent struct {
    domcore.Event
}

class: ProgressEvent

func NewProgressEvent Uses

func NewProgressEvent(_type string, eventInitDict *ProgressEventInit) (_result *ProgressEvent)

func ProgressEventFromJS Uses

func ProgressEventFromJS(value js.Wrapper) *ProgressEvent

ProgressEventFromJS is casting a js.Wrapper into ProgressEvent.

func (*ProgressEvent) LengthComputable Uses

func (_this *ProgressEvent) LengthComputable() bool

LengthComputable returning attribute 'lengthComputable' with type bool (idl: boolean).

func (*ProgressEvent) Loaded Uses

func (_this *ProgressEvent) Loaded() int

Loaded returning attribute 'loaded' with type int (idl: unsigned long long).

func (*ProgressEvent) Total Uses

func (_this *ProgressEvent) Total() int

Total returning attribute 'total' with type int (idl: unsigned long long).

type ProgressEventInit Uses

type ProgressEventInit struct {
    Bubbles          bool
    Cancelable       bool
    Composed         bool
    LengthComputable bool
    Loaded           int
    Total            int
}

dictionary: ProgressEventInit

func ProgressEventInitFromJS Uses

func ProgressEventInitFromJS(value js.Wrapper) *ProgressEventInit

ProgressEventInitFromJS is allocating a new ProgressEventInit object and copy all values from input javascript object

func (*ProgressEventInit) JSValue Uses

func (_this *ProgressEventInit) JSValue() js.Value

JSValue is allocating a new javasript object and copy all values

type Union Uses

type Union struct {
    Value js.Value
}

func UnionFromJS Uses

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue Uses

func (u *Union) JSValue() js.Value

type XMLHttpRequest Uses

type XMLHttpRequest struct {
    XMLHttpRequestEventTarget
}

class: XMLHttpRequest

func NewXMLHttpRequest Uses

func NewXMLHttpRequest() (_result *XMLHttpRequest)

func XMLHttpRequestFromJS Uses

func XMLHttpRequestFromJS(value js.Wrapper) *XMLHttpRequest

XMLHttpRequestFromJS is casting a js.Wrapper into XMLHttpRequest.

func (*XMLHttpRequest) Abort Uses

func (_this *XMLHttpRequest) Abort()

func (*XMLHttpRequest) AddEventReadyStateChange Uses

func (_this *XMLHttpRequest) AddEventReadyStateChange(listener func(event *domcore.Event, currentTarget *XMLHttpRequest)) js.Func

AddReadyStateChange is adding doing AddEventListener for 'ReadyStateChange' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequest) GetAllResponseHeaders Uses

func (_this *XMLHttpRequest) GetAllResponseHeaders() (_result *patch.ByteString)

func (*XMLHttpRequest) GetResponseHeader Uses

func (_this *XMLHttpRequest) GetResponseHeader(name *patch.ByteString) (_result *patch.ByteString)

func (*XMLHttpRequest) OnReadyStateChange Uses

func (_this *XMLHttpRequest) OnReadyStateChange() domcore.EventHandlerFunc

OnReadyStateChange returning attribute 'onreadystatechange' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequest) Open Uses

func (_this *XMLHttpRequest) Open(method *patch.ByteString, url string)

func (*XMLHttpRequest) Open2 Uses

func (_this *XMLHttpRequest) Open2(method *patch.ByteString, url string, async bool, username *string, password *string)

func (*XMLHttpRequest) OverrideMimeType Uses

func (_this *XMLHttpRequest) OverrideMimeType(mime string)

func (*XMLHttpRequest) ReadyState Uses

func (_this *XMLHttpRequest) ReadyState() int

ReadyState returning attribute 'readyState' with type int (idl: unsigned short).

func (*XMLHttpRequest) Response Uses

func (_this *XMLHttpRequest) Response() js.Value

Response returning attribute 'response' with type Any (idl: any).

func (*XMLHttpRequest) ResponseText Uses

func (_this *XMLHttpRequest) ResponseText() string

ResponseText returning attribute 'responseText' with type string (idl: USVString).

func (*XMLHttpRequest) ResponseType Uses

func (_this *XMLHttpRequest) ResponseType() XMLHttpRequestResponseType

ResponseType returning attribute 'responseType' with type XMLHttpRequestResponseType (idl: XMLHttpRequestResponseType).

func (*XMLHttpRequest) ResponseURL Uses

func (_this *XMLHttpRequest) ResponseURL() string

ResponseURL returning attribute 'responseURL' with type string (idl: USVString).

func (*XMLHttpRequest) ResponseXML Uses

func (_this *XMLHttpRequest) ResponseXML() js.Value

ResponseXML returning attribute 'responseXML' with type js.Value (idl: Document).

Code:

var req *xhr.XMLHttpRequest

// cast to correct type
value := webapi.DocumentFromJS(req.ResponseXML())

// do something with value
_ = value

func (*XMLHttpRequest) Send Uses

func (_this *XMLHttpRequest) Send(body *Union)

func (*XMLHttpRequest) SetOnReadyStateChange Uses

func (_this *XMLHttpRequest) SetOnReadyStateChange(listener func(event *domcore.Event, currentTarget *XMLHttpRequest)) js.Func

SetOnReadyStateChange is assigning a function to 'onreadystatechange'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequest) SetRequestHeader Uses

func (_this *XMLHttpRequest) SetRequestHeader(name *patch.ByteString, value *patch.ByteString)

func (*XMLHttpRequest) SetResponseType Uses

func (_this *XMLHttpRequest) SetResponseType(value XMLHttpRequestResponseType)

SetResponseType setting attribute 'responseType' with type XMLHttpRequestResponseType (idl: XMLHttpRequestResponseType).

func (*XMLHttpRequest) SetTimeout Uses

func (_this *XMLHttpRequest) SetTimeout(value uint)

SetTimeout setting attribute 'timeout' with type uint (idl: unsigned long).

func (*XMLHttpRequest) SetWithCredentials Uses

func (_this *XMLHttpRequest) SetWithCredentials(value bool)

SetWithCredentials setting attribute 'withCredentials' with type bool (idl: boolean).

func (*XMLHttpRequest) Status Uses

func (_this *XMLHttpRequest) Status() int

Status returning attribute 'status' with type int (idl: unsigned short).

func (*XMLHttpRequest) StatusText Uses

func (_this *XMLHttpRequest) StatusText() *patch.ByteString

StatusText returning attribute 'statusText' with type patch.ByteString (idl: ByteString).

func (*XMLHttpRequest) Timeout Uses

func (_this *XMLHttpRequest) Timeout() uint

Timeout returning attribute 'timeout' with type uint (idl: unsigned long).

func (*XMLHttpRequest) Upload Uses

func (_this *XMLHttpRequest) Upload() *XMLHttpRequestUpload

Upload returning attribute 'upload' with type XMLHttpRequestUpload (idl: XMLHttpRequestUpload).

func (*XMLHttpRequest) WithCredentials Uses

func (_this *XMLHttpRequest) WithCredentials() bool

WithCredentials returning attribute 'withCredentials' with type bool (idl: boolean).

type XMLHttpRequestEventTarget Uses

type XMLHttpRequestEventTarget struct {
    domcore.EventTarget
}

class: XMLHttpRequestEventTarget

func XMLHttpRequestEventTargetFromJS Uses

func XMLHttpRequestEventTargetFromJS(value js.Wrapper) *XMLHttpRequestEventTarget

XMLHttpRequestEventTargetFromJS is casting a js.Wrapper into XMLHttpRequestEventTarget.

func (*XMLHttpRequestEventTarget) AddEventAbort Uses

func (_this *XMLHttpRequestEventTarget) AddEventAbort(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddAbort is adding doing AddEventListener for 'Abort' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) AddEventError Uses

func (_this *XMLHttpRequestEventTarget) AddEventError(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddError is adding doing AddEventListener for 'Error' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) AddEventLoad Uses

func (_this *XMLHttpRequestEventTarget) AddEventLoad(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddLoad is adding doing AddEventListener for 'Load' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) AddEventLoadEnd Uses

func (_this *XMLHttpRequestEventTarget) AddEventLoadEnd(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddLoadEnd is adding doing AddEventListener for 'LoadEnd' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) AddEventLoadStart Uses

func (_this *XMLHttpRequestEventTarget) AddEventLoadStart(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddLoadStart is adding doing AddEventListener for 'LoadStart' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) AddEventProgress Uses

func (_this *XMLHttpRequestEventTarget) AddEventProgress(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddProgress is adding doing AddEventListener for 'Progress' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) AddEventTimeOut Uses

func (_this *XMLHttpRequestEventTarget) AddEventTimeOut(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

AddTimeOut is adding doing AddEventListener for 'TimeOut' on target. This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) OnAbort Uses

func (_this *XMLHttpRequestEventTarget) OnAbort() domcore.EventHandlerFunc

OnAbort returning attribute 'onabort' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) OnError Uses

func (_this *XMLHttpRequestEventTarget) OnError() domcore.EventHandlerFunc

OnError returning attribute 'onerror' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) OnLoad Uses

func (_this *XMLHttpRequestEventTarget) OnLoad() domcore.EventHandlerFunc

OnLoad returning attribute 'onload' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) OnLoadEnd Uses

func (_this *XMLHttpRequestEventTarget) OnLoadEnd() domcore.EventHandlerFunc

OnLoadEnd returning attribute 'onloadend' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) OnLoadStart Uses

func (_this *XMLHttpRequestEventTarget) OnLoadStart() domcore.EventHandlerFunc

OnLoadStart returning attribute 'onloadstart' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) OnProgress Uses

func (_this *XMLHttpRequestEventTarget) OnProgress() domcore.EventHandlerFunc

OnProgress returning attribute 'onprogress' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) OnTimeOut Uses

func (_this *XMLHttpRequestEventTarget) OnTimeOut() domcore.EventHandlerFunc

OnTimeOut returning attribute 'ontimeout' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*XMLHttpRequestEventTarget) SetOnAbort Uses

func (_this *XMLHttpRequestEventTarget) SetOnAbort(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnAbort is assigning a function to 'onabort'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) SetOnError Uses

func (_this *XMLHttpRequestEventTarget) SetOnError(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnError is assigning a function to 'onerror'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) SetOnLoad Uses

func (_this *XMLHttpRequestEventTarget) SetOnLoad(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnLoad is assigning a function to 'onload'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) SetOnLoadEnd Uses

func (_this *XMLHttpRequestEventTarget) SetOnLoadEnd(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnLoadEnd is assigning a function to 'onloadend'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) SetOnLoadStart Uses

func (_this *XMLHttpRequestEventTarget) SetOnLoadStart(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnLoadStart is assigning a function to 'onloadstart'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) SetOnProgress Uses

func (_this *XMLHttpRequestEventTarget) SetOnProgress(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnProgress is assigning a function to 'onprogress'. This This method is returning allocated javascript function that need to be released.

func (*XMLHttpRequestEventTarget) SetOnTimeOut Uses

func (_this *XMLHttpRequestEventTarget) SetOnTimeOut(listener func(event *ProgressEvent, currentTarget *XMLHttpRequestEventTarget)) js.Func

SetOnTimeOut is assigning a function to 'ontimeout'. This This method is returning allocated javascript function that need to be released.

type XMLHttpRequestResponseType Uses

type XMLHttpRequestResponseType int

enum: XMLHttpRequestResponseType

const (
    EmptyString0XMLHttpRequestResponseType XMLHttpRequestResponseType = iota
    ArraybufferXMLHttpRequestResponseType
    BlobXMLHttpRequestResponseType
    DocumentXMLHttpRequestResponseType
    JsonXMLHttpRequestResponseType
    TextXMLHttpRequestResponseType
)

func XMLHttpRequestResponseTypeFromJS Uses

func XMLHttpRequestResponseTypeFromJS(value js.Value) XMLHttpRequestResponseType

XMLHttpRequestResponseTypeFromJS is converting a javascript value into a XMLHttpRequestResponseType enum value.

func (*XMLHttpRequestResponseType) JSValue Uses

func (this *XMLHttpRequestResponseType) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (XMLHttpRequestResponseType) Value Uses

func (this XMLHttpRequestResponseType) Value() string

Value is converting this into javascript defined string value

type XMLHttpRequestUpload Uses

type XMLHttpRequestUpload struct {
    XMLHttpRequestEventTarget
}

class: XMLHttpRequestUpload

func XMLHttpRequestUploadFromJS Uses

func XMLHttpRequestUploadFromJS(value js.Wrapper) *XMLHttpRequestUpload

XMLHttpRequestUploadFromJS is casting a js.Wrapper into XMLHttpRequestUpload.

Package xhr imports 3 packages (graph) and is imported by 5 packages. Updated 2019-09-22. Refresh now. Tools for package owners.