当前位置: 首页>>代码示例>>Java>>正文


Java Resource.queryParam方法代码示例

本文整理汇总了Java中org.apache.wink.client.Resource.queryParam方法的典型用法代码示例。如果您正苦于以下问题:Java Resource.queryParam方法的具体用法?Java Resource.queryParam怎么用?Java Resource.queryParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wink.client.Resource的用法示例。


在下文中一共展示了Resource.queryParam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: genericRestRequestPut

import org.apache.wink.client.Resource; //导入方法依赖的package包/类
/**
 * Generic rest client for basic rest PUT calls over REST based on Apache Wink
 *
 * @param resourceUrl     Resource endpoint Url
 * @param contentType     ContentType of request
 * @param acceptMediaType ContentType for response
 * @param postBody        Body
 * @param queryParamMap   Map of Query parameters
 * @param headerMap       Map of headers
 * @param cookie          jSessionID in form of JSESSIONID=<ID>
 * @return                Returns the response from the REST client
 */
public ClientResponse genericRestRequestPut(String resourceUrl, String contentType, String acceptMediaType,
        Object postBody, Map<String, String> queryParamMap, Map<String, String> headerMap, String cookie) {

    Resource resource = client.resource(resourceUrl);

    if (!(queryParamMap.size() <= 0)) {
        for (Map.Entry<String, String> queryParamEntry : queryParamMap.entrySet()) {
            resource.queryParam(queryParamEntry.getKey(), queryParamEntry.getValue());
        }
    }
    if (!(headerMap.size() <= 0)) {
        for (Map.Entry<String, String> headerEntry : headerMap.entrySet()) {
            resource.header(headerEntry.getKey(), headerEntry.getValue());
        }
    }
    if (cookie != null) {
        resource.cookie(cookie);
    }
    response = resource.contentType(contentType).
            accept(acceptMediaType).put(postBody);
    return response;
}
 
开发者ID:wso2,项目名称:product-es,代码行数:35,代码来源:GenericRestClient.java

示例2: geneticRestRequestDelete

import org.apache.wink.client.Resource; //导入方法依赖的package包/类
public ClientResponse geneticRestRequestDelete(String resourceUrl, String contentType,
                                               String acceptMediaType,
                                               Map<String, String> queryParamMap,
                                               Map<String, String> headerMap,
                                               String cookie) {
    Resource resource = client.resource(resourceUrl);
    if (!(queryParamMap.size() <= 0)) {
        for (Map.Entry<String, String> queryParamEntry : queryParamMap.entrySet()) {
            resource.queryParam(queryParamEntry.getKey(), queryParamEntry.getValue());
        }
    }
    if (!(headerMap.size() <= 0)) {
        for (Map.Entry<String, String> headerEntry : headerMap.entrySet()) {
            resource.header(headerEntry.getKey(), headerEntry.getValue());
        }
    }
    if (cookie != null) {
        resource.cookie(cookie);
    }

    response = resource.contentType(contentType).
            accept(acceptMediaType).delete();
    return response;
}
 
开发者ID:wso2,项目名称:product-es,代码行数:25,代码来源:GenericRestClient.java

示例3: geneticRestRequestPost

import org.apache.wink.client.Resource; //导入方法依赖的package包/类
/**
 * Generic rest client for basic rest POST calls over REST based on Apache Wink
 *
 * @param resourceUrl     Resource endpoint Url
 * @param contentType     ContentType of request
 * @param acceptMediaType ContentType for response
 * @param postBody        Body
 * @param queryParamMap   Map of Query parameters
 * @param headerMap       Map of headers
 * @param cookie          jSessionID in form of JSESSIONID=<ID>
 * @return
 */
public ClientResponse geneticRestRequestPost(String resourceUrl, String contentType,
                                             String acceptMediaType, Object postBody,
                                             Map<String, String> queryParamMap,
                                             Map<String, String> headerMap,
                                             String cookie) {

    Resource resource = client.resource(resourceUrl);


    if (!(queryParamMap.size() <= 0)) {
        for (Map.Entry<String, String> queryParamEntry : queryParamMap.entrySet()) {
            resource.queryParam(queryParamEntry.getKey(), queryParamEntry.getValue());
        }
    }
    if (!(headerMap.size() <= 0)) {
        for (Map.Entry<String, String> headerEntry : headerMap.entrySet()) {
            resource.header(headerEntry.getKey(), headerEntry.getValue());
        }
    }
    if (cookie != null) {
        resource.cookie(cookie);
    }
    response = resource.contentType(contentType).
            accept(acceptMediaType).post(postBody);
    return response;
}
 
开发者ID:wso2,项目名称:product-es,代码行数:39,代码来源:GenericRestClient.java


注:本文中的org.apache.wink.client.Resource.queryParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。