congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
RawHttp.getFramedBody
Code IndexAdd Tabnine to your IDE (free)

How to use
getFramedBody
method
in
rawhttp.core.RawHttp

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

origin: com.athaydes.rawhttp/rawhttp-core

private BodyReader createBodyReader(InputStream inputStream, StartLine startLine, RawHttpHeaders headers) {
  return new LazyBodyReader(getFramedBody(startLine, headers), inputStream);
}
origin: renatoathaydes/rawhttp

private BodyReader createBodyReader(InputStream inputStream, StartLine startLine, RawHttpHeaders headers) {
  return new LazyBodyReader(getFramedBody(startLine, headers), inputStream);
}
origin: renatoathaydes/rawhttp

public RawHttpResponse<CloseableHttpResponse> send(RawHttpRequest request) throws IOException {
  RequestBuilder builder = RequestBuilder.create(request.getMethod());
  builder.setUri(request.getUri());
  builder.setVersion(toProtocolVersion(request.getStartLine().getHttpVersion()));
  request.getHeaders().getHeaderNames().forEach((name) ->
      request.getHeaders().get(name).forEach(value ->
          builder.addHeader(new BasicHeader(name, value))));
  request.getBody().ifPresent(b -> builder.setEntity(new InputStreamEntity(b.asRawStream())));
  CloseableHttpResponse response = httpClient.execute(builder.build());
  RawHttpHeaders headers = readHeaders(response);
  StatusLine statusLine = adaptStatus(response.getStatusLine());
  @Nullable LazyBodyReader body;
  if (response.getEntity() != null) {
    FramedBody framedBody = http.getFramedBody(statusLine, headers);
    body = new LazyBodyReader(framedBody, response.getEntity().getContent());
  } else {
    body = null;
  }
  return new RawHttpResponse<>(response, request, statusLine, headers, body);
}
rawhttp.coreRawHttpgetFramedBody

Javadoc

Get the framed body of a HTTP message with the given start-line and headers.

This method assumes the message has a body. To check if a HTTP message has a body, call RawHttp#requestHasBody(RawHttpHeaders) or RawHttp#responseHasBody(StatusLine,RequestLine).

Popular methods of RawHttp

  • <init>
    Create a configured instance of RawHttp.
  • parseRequest
    Parses the given HTTP request.
  • parseResponse
    Parses the given HTTP response.
  • createBodyReader
  • requestHasBody
    Determines whether a request with the given headers should have a body.
  • responseHasBody
    Determines whether a response with the given status-line should have a body. If provided, the reques
  • 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

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getResourceAsStream (ClassLoader)
  • compareTo (BigDecimal)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Kernel (java.awt.image)
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Collectors (java.util.stream)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now