Package com.esri.gpt.framework.http

Examples of com.esri.gpt.framework.http.StringProvider


    String sType = "application/x-www-form-urlencoded";
    StringBuilder params = new StringBuilder();
    connection.appendToken(params);
    AgpProperties hdr = connection.makeRequestHeaderProperties();
    AgpClient client = connection.ensureClient();
    StringProvider provider = new StringProvider(params.toString(),sType);
    StringHandler handler = new StringHandler();
   
    client.executeRequest(sUrl,hdr,provider,handler);
    return Val.removeBOM(handler.getContent());
  }
View Full Code Here


    client.setConnectionTimeMs(this.getConnectTimeout());
  }

  // Send a request
  if (Val.chkStr(method).equalsIgnoreCase("post")) {
    ContentProvider contentProvider = new StringProvider(postdata, "text/xml");
    client.setContentProvider(contentProvider);
   
  } else {
    client.setMethodName(MethodName.GET);
  }
View Full Code Here

                                       StringBuilder content,
                                       String contentType)
    throws Exception {
    ContentProvider provider = null;
    if ((content != null) && (content.length() > 0)) {
      provider = new StringProvider(content.toString(),contentType);
    }
    return this.executeJsonRequest(url,requestHeader,provider);
  }
View Full Code Here

    String rqType = "application/x-www-form-urlencoded";
    StringBuilder rqParams = new StringBuilder();
    srcCon.appendToken(rqParams);
    AgpProperties hdr = srcCon.makeRequestHeaderProperties();
    AgpClient client = srcCon.ensureClient();
    StringProvider provider = new StringProvider(rqParams.toString(),rqType);
       
    this.step = "connectingToSource";
    try {
      client.executeRequest(sUrl,hdr,provider,
        new ContentHandler() {
View Full Code Here

      if (extent != null && !extent.isEmpty()) {
        content += "&extent=" + extent.getMinX() + "," + extent.getMinY() + ","
            + extent.getMaxX() + "," + extent.getMaxY();
      }
      HttpClientRequest httpClient = new HttpClientRequest();
      httpClient.setContentProvider(new StringProvider(content,
          "application/x-www-form-urlencoded"));
      httpClient.setUrl(this.addItemUrl);
      httpClient.setRequestHeader("Referer", this.referer);
      httpClient.setMethodName(MethodName.POST);
      httpClient.execute();
View Full Code Here

    HttpClientRequest httpClient = new HttpClientRequest();
    // send the request
    content += "&expiration=525600&referer=" + this.referer;

    httpClient.setContentProvider(new StringProvider(content,
        "application/x-www-form-urlencoded"));

    httpClient.setRequestHeader("Referer", this.referer);
    httpClient.setUrl(this.ep.getGenerateTokenUrl());
    httpClient.setMethodName(MethodName.POST);
View Full Code Here

          this.shareItemUrl = shareItemUrl.replace("{0}",
              this.credentialProvider.getUsername());
          content = "f=json&token=" + URLEncoder.encode(this.token, "UTF-8");
          content += "&everyone=true&items=" + this.itemId;
          HttpClientRequest httpClient = new HttpClientRequest();
          httpClient.setContentProvider(new StringProvider(content,
              "application/x-www-form-urlencoded"));
          httpClient.setRequestHeader("Referer", this.referer);
          httpClient.setUrl(this.shareItemUrl);
          httpClient.setMethodName(MethodName.POST);
          httpClient.execute();
View Full Code Here

    httpClient.setCredentialProvider(provider);
    httpClient.setUrl(serviceUrl);
   // httpClient.setTimeoutMillisecs(service.getTimeoutMillisecs());
    httpClient.setMethodName(MethodName.POST);
//   httpClient.setAxlRequest(getAxlRequest());
    StringProvider cprov = new StringProvider(requestBody,"text/xml");
    httpClient.setContentProvider(cprov);
    StringHandler sh = new StringHandler();
    httpClient.setContentHandler(sh);
 
    httpClient.execute();
View Full Code Here

  try {

    HttpClientRequest cr = new HttpClientRequest();
    cr.setUrl(connectionString);
    ByteArrayHandler sh = new ByteArrayHandler();
    StringProvider cprov = new StringProvider(initString,"text/plain");
    cr.setContentHandler(sh);
    cr.setContentProvider(cprov);
    CredentialProvider cp = getUserName().length()>0 && getUserPassword().length()>0?
      new CredentialProvider(getUserName(),getUserPassword()):
      CredentialProvider.getThreadLocalInstance();
View Full Code Here

        String sCType = "application/x-www-form-urlencoded";
        StringBuilder params = new StringBuilder();
        con.appendToken(params);
        AgpProperties hdr = con.makeRequestHeaderProperties();
        AgpClient client = con.ensureClient();
        StringProvider prov = new StringProvider(params.toString(),sCType);
        StringHandler handler = new StringHandler();;
        client.executeRequest(sUrl,hdr,prov,handler);
        String sWebMapJson = handler.getContent();
       
       
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.http.StringProvider

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.