List of usage examples for com.google.gwt.xhr.client XMLHttpRequest getResponseHeader
public abstract String getResponseHeader(String header);
From source file:playn.http.HttpHtml.java
License:Apache License
private void gotResponse(final HttpRequest req, XMLHttpRequest xhr, String responseBody, final Callback<HttpResponse> callback) throws IOException { int statusCode = -1; String statusLineMessage = null; Map<String, String> responseHeaders = new HashMap<String, String>(); try {//from w ww . j a v a 2 s . c o m statusCode = xhr.getStatus(); statusLineMessage = xhr.getStatusText(); for (String headerName : getAllResponseHeaderNames(xhr)) { String value = xhr.getResponseHeader(headerName); responseHeaders.put(headerName, value); } HttpResponse response = new HttpResponse(statusCode, statusLineMessage, responseHeaders, responseBody); callback.onSuccess(response); } catch (Throwable t) { throw new HttpException(statusCode, statusLineMessage, responseBody, t, HttpErrorType.SERVER_ERROR); } }