Package org.apache.http.entity

Examples of org.apache.http.entity.BufferedHttpEntity


     *
     * @return A new BufferedHttpEntity wrapping the specified entity.
     */
    private HttpEntity newBufferedHttpEntity(HttpEntity entity) {
        try {
            return new BufferedHttpEntity(entity);
        } catch (IOException e) {
            throw new AmazonClientException("Unable to create HTTP entity: " + e.getMessage(), e);
        }
    }
View Full Code Here


     *
     * @return A new BufferedHttpEntity wrapping the specified entity.
     */
    private HttpEntity newBufferedHttpEntity(HttpEntity entity) {
        try {
            return new BufferedHttpEntity(entity);
        } catch (IOException e) {
            throw new AmazonClientException("Unable to create HTTP entity: " + e.getMessage(), e);
        }
    }
View Full Code Here

        if (status > 299) {

            // Buffer response content
            HttpEntity entity = response.getEntity();
            if (entity != null) {
                response.setEntity(new BufferedHttpEntity(entity));
            }

            this.managedConn.close();
            throw new TunnelRefusedException("CONNECT refused by proxy: " +
                    response.getStatusLine(), response);
View Full Code Here

    }

    @Override
    public Response post(String url, final String data) {
        try {
            BufferedHttpEntity entity = new BufferedHttpEntity(new StringEntity(data, "UTF-8"));
            HttpPost post = new HttpPost(url);
            post.setEntity(entity);
            post.setHeader("Content-Type", "application/json");
            return execute(post);
        } catch (UnsupportedEncodingException e) {
View Full Code Here

    }

    @Override
    public Response put(String url, final String data) {
        try {
            BufferedHttpEntity entity = new BufferedHttpEntity(new StringEntity(data, "UTF-8"));
            HttpPut put = new HttpPut(url);
            put.setEntity(entity);
            put.setHeader("Content-Type", "application/json");
            return execute(put);
        } catch (UnsupportedEncodingException e) {
View Full Code Here

    int i = localHttpResponse.getStatusLine().getStatusCode();
    if (i > 299)
    {
      HttpEntity localHttpEntity1 = localHttpResponse.getEntity();
      if (localHttpEntity1 != null)
        localHttpResponse.setEntity(new BufferedHttpEntity(localHttpEntity1));
      this.managedConn.close();
      throw new TunnelRefusedException("CONNECT refused by proxy: " + localHttpResponse.getStatusLine(), localHttpResponse);
    }
    this.managedConn.markReusable();
    return false;
View Full Code Here

        if (status > 299) {

            // Buffer response content
            final HttpEntity entity = response.getEntity();
            if (entity != null) {
                response.setEntity(new BufferedHttpEntity(entity));
            }

            this.managedConn.close();
            throw new TunnelRefusedException("CONNECT refused by proxy: " +
                    response.getStatusLine(), response);
View Full Code Here

        if (status > 299) {

            // Buffer response content
            final HttpEntity entity = response.getEntity();
            if (entity != null) {
                response.setEntity(new BufferedHttpEntity(entity));
            }

            managedConn.close();
            throw new TunnelRefusedException("CONNECT refused by proxy: " +
                    response.getStatusLine(), response);
View Full Code Here

        if (status > 299) {

            // Buffer response content
            final HttpEntity entity = response.getEntity();
            if (entity != null) {
                response.setEntity(new BufferedHttpEntity(entity));
            }

            this.managedConn.close();
            throw new TunnelRefusedException("CONNECT refused by proxy: " +
                    response.getStatusLine(), response);
View Full Code Here

  }

  @Override
  public void completed(final HttpResponse response) {
    try {
      response.setEntity(new BufferedHttpEntity(response.getEntity()));
    } catch(IOException ex) {
      throw new RuntimeException("Could not convert HttpEntity content.");
    }

    int statusCode = response.getStatusLine().getStatusCode();
View Full Code Here

TOP

Related Classes of org.apache.http.entity.BufferedHttpEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.