AjaxEventStream

Companion:
class
class Object
trait Matchable
class Any

Type members

Classlikes

final case class AjaxAbort(xhr: XMLHttpRequest) extends AjaxStreamError
final case class AjaxNetworkError(xhr: XMLHttpRequest, message: String) extends AjaxStreamError
final case class AjaxStatusError(xhr: XMLHttpRequest, status: Int, message: String) extends AjaxStreamError
sealed abstract class AjaxStreamError(val xhr: XMLHttpRequest, message: String) extends Exception

A more detailed version of dom.ext.AjaxException (no relation)

A more detailed version of dom.ext.AjaxException (no relation)

final case class AjaxTimeout(xhr: XMLHttpRequest) extends AjaxStreamError

Value members

Concrete methods

def defaultIsStatusCodeSuccess(status: Int): Boolean
def delete(url: String, data: InputData, timeoutMs: Int, headers: Map[String, String], withCredentials: Boolean, responseType: String, isStatusCodeSuccess: Int => Boolean, requestObserver: Observer[XMLHttpRequest], progressObserver: Observer[(XMLHttpRequest, ProgressEvent)], readyStateChangeObserver: Observer[XMLHttpRequest]): AjaxEventStream

Returns an EventStream that performs an HTTP DELETE request.

Returns an EventStream that performs an HTTP DELETE request.

See also:
def get(url: String, data: InputData, timeoutMs: Int, headers: Map[String, String], withCredentials: Boolean, responseType: String, isStatusCodeSuccess: Int => Boolean, requestObserver: Observer[XMLHttpRequest], progressObserver: Observer[(XMLHttpRequest, ProgressEvent)], readyStateChangeObserver: Observer[XMLHttpRequest]): AjaxEventStream

Returns an EventStream that performs an HTTP GET request.

Returns an EventStream that performs an HTTP GET request.

See also:
def initRequest(timeoutMs: Int, withCredentials: Boolean, responseType: String): XMLHttpRequest

Initializes and configures the XmlHttpRequest. This does not cause any network activity.

Initializes and configures the XmlHttpRequest. This does not cause any network activity.

Note: after initializing the request, you need to openRequest(), and then sendRequest()

AjaxEventStream already does this internally. This is provided as a building block for custom logic.

def patch(url: String, data: InputData, timeoutMs: Int, headers: Map[String, String], withCredentials: Boolean, responseType: String, isStatusCodeSuccess: Int => Boolean, requestObserver: Observer[XMLHttpRequest], progressObserver: Observer[(XMLHttpRequest, ProgressEvent)], readyStateChangeObserver: Observer[XMLHttpRequest]): AjaxEventStream

Returns an EventStream that performs an HTTP PATCH request.

Returns an EventStream that performs an HTTP PATCH request.

See also:
def post(url: String, data: InputData, timeoutMs: Int, headers: Map[String, String], withCredentials: Boolean, responseType: String, isStatusCodeSuccess: Int => Boolean, requestObserver: Observer[XMLHttpRequest], progressObserver: Observer[(XMLHttpRequest, ProgressEvent)], readyStateChangeObserver: Observer[XMLHttpRequest]): AjaxEventStream

Returns an EventStream that performs an HTTP POST request.

Returns an EventStream that performs an HTTP POST request.

See also:
def put(url: String, data: InputData, timeoutMs: Int, headers: Map[String, String], withCredentials: Boolean, responseType: String, isStatusCodeSuccess: Int => Boolean, requestObserver: Observer[XMLHttpRequest], progressObserver: Observer[(XMLHttpRequest, ProgressEvent)], readyStateChangeObserver: Observer[XMLHttpRequest]): AjaxEventStream

Returns an EventStream that performs an HTTP PUT request.

Returns an EventStream that performs an HTTP PUT request.

See also:
def sendRequest(request: XMLHttpRequest, method: String, url: String, data: InputData, headers: Map[String, String]): Unit

The request should be initialized and configured with all the callbacks by this point.

The request should be initialized and configured with all the callbacks by this point.

AjaxEventStream already does this internally. This is provided as a building block for custom logic.