Class Xhr
- java.lang.Object
-
- com.vaadin.client.gwt.elemental.js.util.Xhr
-
public class Xhr extends Object
A Simpler way to useXMLHttpRequest. Copied from the GWT project to make get/post return the XmlHttpRequest- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceXhr.CallbackNotifies when an XHR successfully completes, or errors out.
-
Constructor Summary
Constructors Constructor Description Xhr()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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.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.
-
-
-
Method Detail
-
get
public static com.google.gwt.xhr.client.XMLHttpRequest get(String url, Xhr.Callback callback)
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
-
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
public static com.google.gwt.xhr.client.XMLHttpRequest head(String url, Xhr.Callback callback)
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
-
-