Class Xhr
java.lang.Object
com.vaadin.client.gwt.elemental.js.util.Xhr
A Simpler way to use
XMLHttpRequest.
Copied from the GWT project to make get/post return the XmlHttpRequest- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNotifies when an XHR successfully completes, or errors out. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.gwt.xhr.client.XMLHttpRequestget(elemental.html.Window window, String url, Xhr.Callback callback) Send a GET request to theurland dispatch updates to thecallback.static com.google.gwt.xhr.client.XMLHttpRequestget(String url, Xhr.Callback callback) Send a GET request to theurland dispatch updates to thecallback.static com.google.gwt.xhr.client.XMLHttpRequestgetWithCredentials(String url, Xhr.Callback callback) Send a GET request to theurlincluding credentials in XHR, and dispatch updates to thecallback.static com.google.gwt.xhr.client.XMLHttpRequesthead(elemental.html.Window window, String url, Xhr.Callback callback) Send a HEAD request to theurland dispatch updates to thecallback.static com.google.gwt.xhr.client.XMLHttpRequesthead(String url, Xhr.Callback callback) Send a HEAD request to theurland dispatch updates to thecallback.static com.google.gwt.xhr.client.XMLHttpRequestpost(elemental.html.Window window, String url, String requestData, String contentType, Xhr.Callback callback) Send a POST request to theurland dispatch updates to thecallback.static com.google.gwt.xhr.client.XMLHttpRequestpost(String url, String requestData, String contentType, Xhr.Callback callback) Send a POST request to theurland dispatch updates to thecallback.
-
Constructor Details
-
Xhr
public Xhr()
-
-
Method Details
-
get
Send a GET request to theurland dispatch updates to thecallback.- Parameters:
url- the URLcallback- the callback to be notified- Returns:
- a reference to the sent XmlHttpRequest
-
getWithCredentials
public static com.google.gwt.xhr.client.XMLHttpRequest getWithCredentials(String url, Xhr.Callback callback) Send a GET request to theurlincluding credentials in XHR, and dispatch updates to thecallback.- Parameters:
url- the URLcallback- the callback to be notified- Returns:
- a reference to the sent XmlHttpRequest
-
get
public static com.google.gwt.xhr.client.XMLHttpRequest get(elemental.html.Window window, String url, Xhr.Callback callback) Send a GET request to theurland dispatch updates to thecallback.- Parameters:
window- the window object used to access the XMLHttpRequest constructorurl- the URLcallback- the callback to be notified- Returns:
- a reference to the sent XmlHttpRequest
-
head
Send a HEAD request to theurland dispatch updates to thecallback.- Parameters:
url- the URLcallback- the callback to be notified- Returns:
- a reference to the sent XmlHttpRequest
-
head
public static com.google.gwt.xhr.client.XMLHttpRequest head(elemental.html.Window window, String url, Xhr.Callback callback) Send a HEAD request to theurland dispatch updates to thecallback.- Parameters:
window- the window object used to access the XMLHttpRequest constructorurl- the URLcallback- the callback to be notified- Returns:
- a reference to the sent XmlHttpRequest
-
post
public static com.google.gwt.xhr.client.XMLHttpRequest post(String url, String requestData, String contentType, Xhr.Callback callback) Send a POST request to theurland dispatch updates to thecallback.- Parameters:
url- the URLrequestData- the data to be passed to XMLHttpRequest.sendcontentType- a value for the Content-Type HTTP headercallback- the callback to notify- Returns:
- a reference to the sent XmlHttpRequest
-
post
public static com.google.gwt.xhr.client.XMLHttpRequest post(elemental.html.Window window, String url, String requestData, String contentType, Xhr.Callback callback) Send a POST request to theurland dispatch updates to thecallback.- Parameters:
window- the window object used to access the XMLHttpRequest constructorurl- the URLrequestData- the data to be passed to XMLHttpRequest.sendcontentType- a value for the Content-Type HTTP headercallback- the callback to notify- Returns:
- a reference to the sent XmlHttpRequest
-