Package com.google.api.client.http

Examples of com.google.api.client.http.HttpContent


  }

  public DeployInfo deploy(final DeployRequest... requests) throws IOException {
    try {
      String strCont = JSONSerDe.ser(new ArrayList<DeployRequest>(Arrays.asList(requests)));
      HttpContent content = new StringHttpContent(strCont);
      HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(
          qNodes[(int) (Math.random() * qNodes.length)] + "/api/deploy"), content);
      HttpResponse resp = request.execute();
      return JSONSerDe.deSer(asString(resp.getContent()), DeployInfo.class);
    } catch(JSONSerDeException e) {
View Full Code Here


    params.put("sql", query);
    params.put("key", new String[] { key });
    params.put("partition", partition);

    try {
      HttpContent content = new StringHttpContent(JSONSerDe.ser(params));
      HttpRequest request = requestFactory.buildPostRequest(new GenericUrl(
          qNodes[(int) (Math.random() * qNodes.length)] + "/api/query/" + tablespace), content);
      HttpResponse resp = request.execute();
      return JSONSerDe.deSer(asString(resp.getContent()), QueryStatus.class);
    } catch(JSONSerDeException e) {
View Full Code Here

            public void initialize(HttpRequest request) {
            }
          });
      final GenericUrl url = new GenericUrl(this.url);

      HttpContent hc = new AbstractHttpContent("text/json") {
        String content = serialize(jsonServiceRequest);
        @Override
        public long getLength() throws IOException {
          return content.getBytes("utf-8").length;
        }
View Full Code Here

            public void initialize(HttpRequest request) {
            }
          });
      GenericUrl url = new GenericUrl(_url);

      HttpContent hc = new AbstractHttpContent("text/json") {
        String content = serialize(jsonServiceRequest_);
        @Override
        public long getLength() throws IOException {
          return content.getBytes("utf-8").length;
        }
View Full Code Here

            public void initialize(HttpRequest request) {
            }
          });
      GenericUrl url = new GenericUrl(_url);

      HttpContent hc = new AbstractHttpContent("text/json") {
        String content = serialize(jsonServiceRequest_);
        @Override
        public void writeTo(OutputStream out_) throws IOException {
          String service = _url +jsonServiceRequest_.getService();
          if (maxPayloadLengthToLog < 0 || content.length() <= maxPayloadLengthToLog) {
View Full Code Here

TOP

Related Classes of com.google.api.client.http.HttpContent

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.