Codota Logo
RawHttp.responseHasBody
Code IndexAdd Codota to your IDE (free)

How to use
responseHasBody
method
in
rawhttp.core.RawHttp

Best Java code snippets using rawhttp.core.RawHttp.responseHasBody (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: com.athaydes.rawhttp/rawhttp-core

/**
 * Determines whether a response with the given status-line should have a body.
 * <p>
 * This method ignores the request-line of the request which produced such response. If the request
 * is known, use the {@link #responseHasBody(StatusLine, RequestLine)} method instead.
 *
 * @param statusLine status-line of response
 * @return true if such response has a body, false otherwise
 */
public static boolean responseHasBody(StatusLine statusLine) {
  return responseHasBody(statusLine, null);
}
origin: renatoathaydes/rawhttp

/**
 * Determines whether a response with the given status-line should have a body.
 * <p>
 * This method ignores the request-line of the request which produced such response. If the request
 * is known, use the {@link #responseHasBody(StatusLine, RequestLine)} method instead.
 *
 * @param statusLine status-line of response
 * @return true if such response has a body, false otherwise
 */
public static boolean responseHasBody(StatusLine statusLine) {
  return responseHasBody(statusLine, null);
}
origin: com.athaydes.rawhttp/rawhttp-core

/**
 * Parses the HTTP response produced by the given stream.
 *
 * @param inputStream producing a HTTP response
 * @param requestLine optional {@link RequestLine} of the request which results in this response.
 *                    If provided, it is taken into consideration when deciding whether the response contains
 *                    a body. See <a href="https://tools.ietf.org/html/rfc7230#section-3.3">Section 3.3</a>
 *                    of RFC-7230 for details.
 * @return a parsed HTTP response object
 * @throws InvalidHttpResponse if the response is invalid
 * @throws IOException         if a problem occurs accessing the stream
 */
public RawHttpResponse<Void> parseResponse(InputStream inputStream,
                      @Nullable RequestLine requestLine) throws IOException {
  StatusLine statusLine = metadataParser.parseStatusLine(inputStream);
  RawHttpHeaders headers = metadataParser.parseHeaders(inputStream, (message, lineNumber) ->
      // add 1 to the line number to correct for the start-line
      new InvalidHttpResponse(message, lineNumber + 1));
  @Nullable BodyReader bodyReader = responseHasBody(statusLine, requestLine)
      ? createBodyReader(inputStream, statusLine, headers)
      : null;
  return new RawHttpResponse<>(null, null, statusLine, headers, bodyReader);
}
origin: renatoathaydes/rawhttp

/**
 * Parses the HTTP response produced by the given stream.
 *
 * @param inputStream producing a HTTP response
 * @param requestLine optional {@link RequestLine} of the request which results in this response.
 *                    If provided, it is taken into consideration when deciding whether the response contains
 *                    a body. See <a href="https://tools.ietf.org/html/rfc7230#section-3.3">Section 3.3</a>
 *                    of RFC-7230 for details.
 * @return a parsed HTTP response object
 * @throws InvalidHttpResponse if the response is invalid
 * @throws IOException         if a problem occurs accessing the stream
 */
public RawHttpResponse<Void> parseResponse(InputStream inputStream,
                      @Nullable RequestLine requestLine) throws IOException {
  StatusLine statusLine = metadataParser.parseStatusLine(inputStream);
  RawHttpHeaders headers = metadataParser.parseHeaders(inputStream, (message, lineNumber) ->
      // add 1 to the line number to correct for the start-line
      new InvalidHttpResponse(message, lineNumber + 1));
  @Nullable BodyReader bodyReader = responseHasBody(statusLine, requestLine)
      ? createBodyReader(inputStream, statusLine, headers)
      : null;
  return new RawHttpResponse<>(null, null, statusLine, headers, bodyReader);
}
rawhttp.coreRawHttpresponseHasBody

Javadoc

Determines whether a response with the given status-line should have a body.

This method ignores the request-line of the request which produced such response. If the request is known, use the #responseHasBody(StatusLine,RequestLine) method instead.

Popular methods of RawHttp

  • <init>
    Create a configured instance of RawHttp.
  • parseRequest
    Parses the given HTTP request.
  • parseResponse
    Parses the given HTTP response.
  • getFramedBody
    Get the framed body of a HTTP message with the given start-line and headers. This method assumes th
  • createBodyReader
  • requestHasBody
    Determines whether a request with the given headers should have a body.
  • startsWith
  • verifyHost
  • waitForPortToBeTaken
    Wait for the given port to be taken before proceeding. This is useful for waiting for a server to cl

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now