Package org.cybergarage.http

Examples of org.cybergarage.http.HTTPResponse


    }

    HTTPRequest httpReq = new HTTPRequest();
    httpReq.setMethod(HTTP.GET);
    httpReq.setURI(uri);
    HTTPResponse httpRes = httpReq.post(host, port);
    if (httpRes.isSuccessful() == false)
      throw new ParserException("HTTP comunication failed: no answer from peer." +
          "Unable to retrive resoure -> "+locationURL.toString());
    String content = new String(httpRes.getContent());
    ByteArrayInputStream strBuf = new ByteArrayInputStream(content.getBytes());
    return parse(strBuf);
  }
View Full Code Here


  //  post
  ////////////////////////////////////////////////

  public SOAPResponse postMessage(String host, int port)
  {
    HTTPResponse httpRes = post(host, port);
   
     SOAPResponse soapRes = new SOAPResponse(httpRes);

    byte content[] = soapRes.getContent();
    if (content.length <= 0)
View Full Code Here

    } else {
      httpReq.returnBadRequest();
      return;
    }

    HTTPResponse httpRes = new HTTPResponse();
    httpRes.setStatusCode(HTTPStatus.OK);
    if (contentType != null) {
      httpRes.setContentType(contentType);
    }
    if (contentLanguage != null) {
      // FIXME Check ACCEPT-LANGUAGE header in client request, and set a
      // suitable code.
      httpRes.setContentLanguage(contentLanguage);
    }
    httpRes.setContent(fileByte);

    httpReq.post(httpRes);
  }
View Full Code Here

    int port = sub.getDeliveryPort();
   
    NotifyRequest notifyReq = new NotifyRequest();
    notifyReq.setRequest(sub, varName, value);
   
    HTTPResponse res = notifyReq.post(host, port);
    if (res.isSuccessful() == false)
      return false;
     
    sub.incrementNotifyCount();   
   
    return true;
View Full Code Here

TOP

Related Classes of org.cybergarage.http.HTTPResponse

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.