Examples of NameValuePair


Examples of org.apache.commons.httpclient.NameValuePair

        Assert.assertEquals(getHttpMethodInfo(getMethod), HttpStatus.SC_OK, getMethod.getStatusCode());

        Object object = (Object) unmarshaller.unmarshal(getMethod.getResponseBodyAsStream());

        NameValuePair[] nameValuePairs = new NameValuePair[1];
        nameValuePairs[0] = new NameValuePair("property#tags", TAG_VALUE);

        PostMethod postMethod =
            executePostForm(String.format("%s?method=PUT", getUriBuilder(ObjectResource.class).build(getWiki(), "Main",
                "WebHome", objectToBePut.getClassName(), objectToBePut.getNumber()).toString()), nameValuePairs,
                "Admin", "admin");
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

    public void testPOSTObjectFormUrlEncoded() throws Exception
    {
        final String TAG_VALUE = "TAG";

        NameValuePair[] nameValuePairs = new NameValuePair[2];
        nameValuePairs[0] = new NameValuePair("className", "XWiki.TagClass");
        nameValuePairs[1] = new NameValuePair("property#tags", TAG_VALUE);

        PostMethod postMethod =
            executePostForm(getUriBuilder(ObjectsResource.class).build(getWiki(), "Main", "WebHome").toString(),
                nameValuePairs, "Admin", "admin");
        Assert.assertEquals(getHttpMethodInfo(postMethod), HttpStatus.SC_CREATED, postMethod.getStatusCode());
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

        Link tagsPropertyLink = getFirstLinkByRelation(tagsProperty, Relations.SELF);

        Assert.assertNotNull(tagsPropertyLink);

        NameValuePair[] nameValuePairs = new NameValuePair[1];
        nameValuePairs[0] = new NameValuePair("property#tags", TAG_VALUE);

        PostMethod postMethod =
            executePostForm(String.format("%s?method=PUT", tagsPropertyLink.getHref()), nameValuePairs, "Admin",
                "admin");
        Assert.assertEquals(getHttpMethodInfo(postMethod), HttpStatus.SC_ACCEPTED, postMethod.getStatusCode());
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

    }
   
    HttpClient client = HttpClientFactory.getHttpClientInstance();
    String url = "http://maps.google.com/maps/geo";
    NameValuePair[] nvps = new NameValuePair[5];
    nvps[0] = new NameValuePair("q",textLocation);
    nvps[1] = new NameValuePair("output","csv");
    nvps[2] = new NameValuePair("oe","utf8");
    nvps[3] = new NameValuePair("sensor","false");
    nvps[4] = new NameValuePair("key","ABQIAAAAq5BZJrKbG-xh--W4MrciXRQZTOqTGVCcmpRMgrUbtlJvJ3buAhSfG7H7hgE66BCW17_gLyhitMNP4A");
   
    GetMethod getCall = new GetMethod(url);
    getCall.setQueryString(nvps);
   
    try {
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

      HttpClient httpClient = HttpClientFactory.getHttpClientInstance();
      HttpClientParams httpClientParams = httpClient.getParams();
      httpClientParams.setConnectionManagerTimeout(2500);
      httpClient.setParams(httpClientParams);
      HttpMethod httpMethod = new GetMethod(MSN_NAME_VALIDATION_URL);
      NameValuePair idParam = new NameValuePair(MSN_NAME_URL_PARAMETER, textElement.getValue());
      httpMethod.setQueryString(new NameValuePair[] {idParam});
      // Don't allow redirects since otherwise, we won't be able to get the correct status
      httpMethod.setFollowRedirects(false);
      try {
        // Get the user profile page
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

      HttpClient httpClient = HttpClientFactory.getHttpClientInstance();
      HttpClientParams httpClientParams = httpClient.getParams();
      httpClientParams.setConnectionManagerTimeout(2500);
      httpClient.setParams(httpClientParams);
      HttpMethod httpMethod = new GetMethod(ICQ_NAME_VALIDATION_URL);
      NameValuePair uinParam = new NameValuePair(ICQ_NAME_URL_PARAMETER, textElement.getValue());
      httpMethod.setQueryString(new NameValuePair[] {uinParam});
      // Don't allow redirects since otherwise, we won't be able to get the HTTP 302 further down.
      httpMethod.setFollowRedirects(false);
      try {
        // Get the user profile page
View Full Code Here

Examples of org.apache.hadoop.yarn.server.applicationhistoryservice.timeline.NameValuePair

    if (str == null) {
      return null;
    }
    String[] strs = str.split(delimiter, 2);
    try {
      return new NameValuePair(strs[0].trim(),
          GenericObjectMapper.OBJECT_READER.readValue(strs[1].trim()));
    } catch (Exception e) {
      // didn't work as an Object, keep it as a String
      return new NameValuePair(strs[0].trim(), strs[1].trim());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.server.timeline.NameValuePair

    if (str == null) {
      return null;
    }
    String[] strs = str.split(delimiter, 2);
    try {
      return new NameValuePair(strs[0].trim(),
          GenericObjectMapper.OBJECT_READER.readValue(strs[1].trim()));
    } catch (Exception e) {
      // didn't work as an Object, keep it as a String
      return new NameValuePair(strs[0].trim(), strs[1].trim());
    }
  }
View Full Code Here

Examples of org.apache.http.NameValuePair

            throw new IllegalArgumentException("Char array buffer may not be null");
        }
        if (cursor == null) {
            throw new IllegalArgumentException("Parser cursor may not be null");
        }
        NameValuePair nvp = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        while (!cursor.atEnd()) {
            NameValuePair param = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
            params.add(param);
        }
        return new BasicHeaderElement(
                nvp.getName(),
                nvp.getValue(), params.toArray(new NameValuePair[params.size()]));
View Full Code Here

Examples of org.apache.uima.collection.metadata.NameValuePair

   * (non-Javadoc)
   *
   * @see org.apache.uima.collection.metadata.CasProcessorConfigurationParameterSettings#getParameterValue(java.lang.String)
   */
  public Object getParameterValue(String aParamName) {
    NameValuePair valueObject = getParamValueObject(aParamName);
    if (valueObject != null) {
      return valueObject.getValue();
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.