protected void storeResponseContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { rawResponseContents.write(content); } catch (IOException e) { // can't happen } }
protected void storeRequestContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { requestContents.write(content); } catch (IOException e) { // can't happen } }
/** * Extracts the binary contents from an HTTP message. * * @param httpContent HTTP content object to extract the entity body from * @return binary contents of the HTTP message */ public static byte[] extractBinaryHttpEntityBody(HttpContent httpContent) { return BrowserMobHttpUtil.extractReadableBytes(httpContent.content()); } }
/** * Extracts the entity body from an HTTP content object, according to the specified character set. The character set cannot be null. If * the character set is not specified or is unknown, you still must specify a suitable default charset (see {@link BrowserMobHttpUtil#DEFAULT_HTTP_CHARSET}). * * @param httpContent HTTP content object to extract the entity body from * @param charset character set of the entity body * @return String representation of the entity body * @throws IllegalArgumentException if the charset is null */ public static String extractHttpEntityBody(HttpContent httpContent, Charset charset) { if (charset == null) { throw new IllegalArgumentException("No charset specified when extracting the contents of an HTTP message"); } byte[] contentBytes = BrowserMobHttpUtil.extractReadableBytes(httpContent.content()); return new String(contentBytes, charset); }
protected void storeRequestContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { requestContents.write(content); } catch (IOException e) { // can't happen } }
protected void storeRequestContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { requestContents.write(content); } catch (IOException e) { // can't happen } }
/** * Extracts the binary contents from an HTTP message. * * @param httpContent HTTP content object to extract the entity body from * @return binary contents of the HTTP message */ public static byte[] extractBinaryHttpEntityBody(HttpContent httpContent) { return BrowserMobHttpUtil.extractReadableBytes(httpContent.content()); } }
/** * Extracts the binary contents from an HTTP message. * * @param httpContent HTTP content object to extract the entity body from * @return binary contents of the HTTP message */ public static byte[] extractBinaryHttpEntityBody(HttpContent httpContent) { return BrowserMobHttpUtil.extractReadableBytes(httpContent.content()); } }
protected void storeResponseContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { rawResponseContents.write(content); } catch (IOException e) { // can't happen } }
protected void storeResponseContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { rawResponseContents.write(content); } catch (IOException e) { // can't happen } }
protected void storeRequestContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { requestContents.write(content); } catch (IOException e) { // can't happen } }
protected void storeResponseContent(HttpContent httpContent) { ByteBuf bufferedContent = httpContent.content(); byte[] content = BrowserMobHttpUtil.extractReadableBytes(bufferedContent); try { rawResponseContents.write(content); } catch (IOException e) { // can't happen } }
/** * Extracts the entity body from an HTTP content object, according to the specified character set. The character set cannot be null. If * the character set is not specified or is unknown, you still must specify a suitable default charset (see {@link BrowserMobHttpUtil#DEFAULT_HTTP_CHARSET}). * * @param httpContent HTTP content object to extract the entity body from * @param charset character set of the entity body * @return String representation of the entity body * @throws IllegalArgumentException if the charset is null */ public static String extractHttpEntityBody(HttpContent httpContent, Charset charset) { if (charset == null) { throw new IllegalArgumentException("No charset specified when extracting the contents of an HTTP message"); } byte[] contentBytes = BrowserMobHttpUtil.extractReadableBytes(httpContent.content()); return new String(contentBytes, charset); }
/** * Extracts the entity body from an HTTP content object, according to the specified character set. The character set cannot be null. If * the character set is not specified or is unknown, you still must specify a suitable default charset (see {@link BrowserMobHttpUtil#DEFAULT_HTTP_CHARSET}). * * @param httpContent HTTP content object to extract the entity body from * @param charset character set of the entity body * @return String representation of the entity body * @throws IllegalArgumentException if the charset is null */ public static String extractHttpEntityBody(HttpContent httpContent, Charset charset) { if (charset == null) { throw new IllegalArgumentException("No charset specified when extracting the contents of an HTTP message"); } byte[] contentBytes = BrowserMobHttpUtil.extractReadableBytes(httpContent.content()); return new String(contentBytes, charset); }