/** * Creates a HarResponse object for failed requests. Normally the HarResponse is populated when the response is received * from the server, but if the request fails due to a name resolution issue, connection problem, timeout, etc., no * HarResponse would otherwise be created. * * @return a new HarResponse object with invalid HTTP status code (0) and version string ("unknown") */ public static HarResponse createHarResponseForFailure() { return new HarResponse(HTTP_STATUS_CODE_FOR_FAILURE, HTTP_REASON_PHRASE_FOR_FAILURE, HTTP_VERSION_STRING_FOR_FAILURE); }
protected void captureResponse(HttpResponse httpResponse) { HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text()); harEntry.setResponse(response); captureResponseHeaderSize(httpResponse); captureResponseMimeType(httpResponse); if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) { captureResponseCookies(httpResponse); } if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) { captureResponseHeaders(httpResponse); } if (BrowserMobHttpUtil.isRedirect(httpResponse)) { captureRedirectUrl(httpResponse); } }
/** * Creates a HarResponse object for failed requests. Normally the HarResponse is populated when the response is received * from the server, but if the request fails due to a name resolution issue, connection problem, timeout, etc., no * HarResponse would otherwise be created. * * @return a new HarResponse object with invalid HTTP status code (0) and version string ("unknown") */ public static HarResponse createHarResponseForFailure() { return new HarResponse(HTTP_STATUS_CODE_FOR_FAILURE, HTTP_REASON_PHRASE_FOR_FAILURE, HTTP_VERSION_STRING_FOR_FAILURE); }
/** * Creates a DCResponse object for failed requests. Normally the DCResponse is populated when the response is received * from the server, but if the request fails due to a name resolution issue, connection problem, timeout, etc., no * DCResponse would otherwise be created. * * @return a new DCResponse object with invalid HTTP status code (0) and version string ("unknown") */ public static HarResponse createHarResponseForFailure() { return new HarResponse(HTTP_STATUS_CODE_FOR_FAILURE, HTTP_REASON_PHRASE_FOR_FAILURE, HTTP_VERSION_STRING_FOR_FAILURE); }
/** * Creates a HarResponse object for failed requests. Normally the HarResponse is populated when the response is received * from the server, but if the request fails due to a name resolution issue, connection problem, timeout, etc., no * HarResponse would otherwise be created. * * @return a new HarResponse object with invalid HTTP status code (0) and version string ("unknown") */ public static HarResponse createHarResponseForFailure() { return new HarResponse(HTTP_STATUS_CODE_FOR_FAILURE, HTTP_REASON_PHRASE_FOR_FAILURE, HTTP_VERSION_STRING_FOR_FAILURE); }
protected void captureResponse(HttpResponse httpResponse) { Log.e("InnerHandle", "captureResponse " + harEntry.getId()); HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text()); harEntry.setResponse(response); captureResponseHeaderSize(httpResponse); captureResponseMimeType(httpResponse); if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) { captureResponseCookies(httpResponse); } if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) { captureResponseHeaders(httpResponse); } if (BrowserMobHttpUtil.isRedirect(httpResponse)) { captureRedirectUrl(httpResponse); } }
protected void captureResponse(HttpResponse httpResponse) { HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text()); harEntry.setResponse(response); captureResponseHeaderSize(httpResponse); captureResponseMimeType(httpResponse); if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) { captureResponseCookies(httpResponse); } if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) { captureResponseHeaders(httpResponse); } if (BrowserMobHttpUtil.isRedirect(httpResponse)) { captureRedirectUrl(httpResponse); } }
protected void captureResponse(HttpResponse httpResponse) { HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text()); harEntry.setResponse(response); captureResponseHeaderSize(httpResponse); captureResponseMimeType(httpResponse); if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) { captureResponseCookies(httpResponse); } if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) { captureResponseHeaders(httpResponse); } if (BrowserMobHttpUtil.isRedirect(httpResponse)) { captureRedirectUrl(httpResponse); } }