Package org.eclipse.jetty.client

Examples of org.eclipse.jetty.client.HttpExchange


    @Override
    protected boolean onReadTimeout()
    {
        LOG.debug("{} idle timeout", this);

        HttpExchange exchange = channel.getHttpExchange();
        if (exchange != null)
            return exchange.getRequest().abort(new TimeoutException());

        getHttpDestination().close(this);
        return true;
    }
View Full Code Here


    }

    @Override
    public void onFillable()
    {
        HttpExchange exchange = channel.getHttpExchange();
        if (exchange != null)
        {
            channel.receive();
        }
        else
View Full Code Here

    }

    @Override
    public void send()
    {
        HttpExchange exchange = getHttpExchange();
        if (exchange != null)
            sender.send(exchange);
    }
View Full Code Here

   *            Callback to handle the response with
   */
  public HttpExchange asyncGet(String path, String args, FritzahaCallback callback) {
    if (!isAuthenticated())
      authenticate();
    HttpExchange getExchange = new FritzahaContentExchange(callback);
    getExchange.setMethod("GET");
    getExchange.setURL(getURL(path, addSID(args)));
    try {
      asyncclient.send(getExchange);
    } catch (IOException e) {
      logger.error("An I/O error occurred while sending the GET request " + getURL(path, addSID(args)));
      return null;
View Full Code Here

   *            Callback to handle the response with
   */
  public HttpExchange asyncPost(String path, String args, FritzahaCallback callback) {
    if (!isAuthenticated())
      authenticate();
    HttpExchange postExchange = new FritzahaContentExchange(callback);
    postExchange.setMethod("POST");
    postExchange.setURL(getURL(path));
    try {
      postExchange.setRequestContent(new ByteArrayBuffer(addSID(args).getBytes("UTF-8")));
    } catch (UnsupportedEncodingException e1) {
      logger.error("An encoding error occurred in the POST arguments");
      return null;
    }
    postExchange.setRequestContentType("application/x-www-form-urlencoded;charset=utf-8");
    try {
      asyncclient.send(postExchange);
    } catch (IOException e) {
      logger.error("An I/O error occurred while sending the POST request to " + getURL(path));
      return null;
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.client.HttpExchange

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.