public class Xhr extends Object
XMLHttpRequest
.Modifier and Type | Class and Description |
---|---|
static interface |
Xhr.Callback
Interface for getting notified when an XHR successfully completes, or
errors out.
|
Constructor and Description |
---|
Xhr() |
Modifier and Type | Method and Description |
---|---|
static void |
get(String url,
Xhr.Callback callback)
Send a GET request to the
url and dispatch updates to the
callback . |
static void |
get(Window window,
String url,
Xhr.Callback callback)
Send a GET request to the
url and dispatch updates to the
callback . |
static void |
head(String url,
Xhr.Callback callback)
Send a HEAD request to the
url and dispatch updates to the
callback . |
static void |
head(Window window,
String url,
Xhr.Callback callback)
Send a HEAD request to the
url and dispatch updates to the
callback . |
static void |
post(String url,
String requestData,
String contentType,
Xhr.Callback callback)
Send a POST request to the
url and dispatch updates to the
callback . |
static void |
post(Window window,
String url,
String requestData,
String contentType,
Xhr.Callback callback)
Send a POST request to the
url and dispatch updates to the
callback . |
public static void get(String url, Xhr.Callback callback)
url
and dispatch updates to the
callback
.url
- callback
- public static void get(Window window, String url, Xhr.Callback callback)
url
and dispatch updates to the
callback
.window
- the window object used to access the XMLHttpRequest
constructorurl
- callback
- public static void head(String url, Xhr.Callback callback)
url
and dispatch updates to the
callback
.url
- callback
- public static void head(Window window, String url, Xhr.Callback callback)
url
and dispatch updates to the
callback
.window
- the window object used to access the XMLHttpRequest
constructorurl
- callback
- public static void post(String url, String requestData, String contentType, Xhr.Callback callback)
url
and dispatch updates to the
callback
.url
- requestData
- the data to be passed to XMLHttpRequest.sendcontentType
- a value for the Content-Type HTTP headercallback
- public static void post(Window window, String url, String requestData, String contentType, Xhr.Callback callback)
url
and dispatch updates to the
callback
.window
- the window object used to access the XMLHttpRequest
constructorurl
- requestData
- the data to be passed to XMLHttpRequest.sendcontentType
- a value for the Content-Type HTTP headercallback
- Copyright © 2016. All rights reserved.