• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Fields类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jetty.util.Fields的典型用法代码示例。如果您正苦于以下问题:Java Fields类的具体用法?Java Fields怎么用?Java Fields使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Fields类属于org.eclipse.jetty.util包,在下文中一共展示了Fields类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: postRequest

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
private Request postRequest(ApiURL url, JsonObject r, Timeout timeout) {
	Fields fields = new Fields();
	fields.add("r", GsonUtil.gson.toJson(r));
	Request request = httpClient.newRequest(url.getUrl()).method(HttpMethod.POST).agent(ApiURL.USER_AGENT)
			.header("Origin", url.getOrigin()).content(new FormContentProvider(fields));
	if (url.getReferer() != null) {
		request.header(HttpHeader.REFERER, url.getReferer());
	}
	if (timeout != null) {
		request.timeout(timeout.getTime(), timeout.getUnit());
	}
	return request;
}
 
开发者ID:Xianguang-Zhou,项目名称:smartqq-client,代码行数:14,代码来源:SmartQQClient.java


示例2: getLoginRequest

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
/**
 * Creates login request, allows SalesforceSecurityHandler to create a login request for a failed authentication conversation
 * @return login POST request.
 */
public Request getLoginRequest(HttpConversation conversation) {
    final String loginUrl = (instanceUrl == null ? config.getLoginUrl() : instanceUrl) + OAUTH2_TOKEN_PATH;
    LOG.info("Login user {} at Salesforce loginUrl: {}", config.getUserName(), loginUrl);
    final Fields fields = new Fields(true);

    fields.put("grant_type", "password");
    fields.put("client_id", config.getClientId());
    fields.put("client_secret", config.getClientSecret());
    fields.put("username", config.getUserName());
    fields.put("password", config.getPassword());
    fields.put("format", "json");

    final Request post;
    if (conversation == null) {
        post = httpClient.POST(loginUrl);
    } else {
        post = httpClient.newHttpRequest(conversation, URI.create(loginUrl))
            .method(HttpMethod.POST);
    }

    return post.content(new FormContentProvider(fields))
        .timeout(timeout, TimeUnit.MILLISECONDS);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:28,代码来源:SalesforceSession.java


示例3: createApp

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
public ContentResponse createApp(String gitUrl, String appName) throws Exception {
    Fields fields = new Fields();
    fields.add("gitUrl", gitUrl);
    if (appName != null) {
        fields.add("appName", appName);
    }
    return client.POST(routerUrl + "/api/v1/apps")
        .content(new FormContentProvider(fields)).send();
}
 
开发者ID:danielflower,项目名称:app-runner-router,代码行数:10,代码来源:RestClient.java


示例4: updateApp

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
public ContentResponse updateApp(String gitUrl, String appName) throws Exception {
    Fields fields = new Fields();
    fields.add("gitUrl", gitUrl);
    return client.newRequest(routerUrl + "/api/v1/apps/" + appName)
        .method("PUT")
        .content(new FormContentProvider(fields)).send();
}
 
开发者ID:danielflower,项目名称:app-runner-router,代码行数:8,代码来源:RestClient.java


示例5: registerRunner

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
public ContentResponse registerRunner(String id, URI url, int maxInstances) throws Exception {
    Fields fields = new Fields();
    fields.add("id", id);
    fields.add("url", url.toString());
    fields.add("maxApps", String.valueOf(maxInstances));
    return client.POST(routerUrl + "/api/v1/runners")
        .content(new FormContentProvider(fields)).send();
}
 
开发者ID:danielflower,项目名称:app-runner-router,代码行数:9,代码来源:RestClient.java


示例6: updateRunner

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
public ContentResponse updateRunner(String id, URI url, int maxInstances) throws Exception {
    Fields fields = new Fields();
    fields.add("url", url.toString());
    fields.add("maxApps", String.valueOf(maxInstances));
    return client.newRequest(routerUrl + "/api/v1/runners/" + id)
        .method("PUT")
        .content(new FormContentProvider(fields)).send();
}
 
开发者ID:danielflower,项目名称:app-runner-router,代码行数:9,代码来源:RestClient.java


示例7: createApp

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
public ContentResponse createApp(String gitUrl, String appName) throws Exception {
    Fields fields = new Fields();
    fields.add("gitUrl", gitUrl);
    if (appName != null) {
        fields.add("appName", appName);
    }
    return client.POST(appRunnerUrl + "/api/v1/apps")
        .content(new FormContentProvider(fields)).send();
}
 
开发者ID:danielflower,项目名称:app-runner,代码行数:10,代码来源:RestClient.java


示例8: updateApp

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
public ContentResponse updateApp(String gitUrl, String appName) throws Exception {
    Fields fields = new Fields();
    fields.add("gitUrl", gitUrl);
    return client.newRequest(appRunnerUrl + "/api/v1/apps/" + appName)
        .method("PUT")
        .content(new FormContentProvider(fields)).send();
}
 
开发者ID:danielflower,项目名称:app-runner,代码行数:8,代码来源:RestClient.java


示例9: formFields

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
private static Fields formFields(ObjectNode content)
{
    Fields fields = new Fields();
    content.fields().forEachRemaining(f -> {
        if (f.getValue().isContainerNode()) {
            throw new ConfigException("Invalid form content field value: " + f.getValue().toString());
        }
        fields.add(f.getKey(), f.getValue().asText());
    });
    return fields;
}
 
开发者ID:treasure-data,项目名称:digdag,代码行数:12,代码来源:HttpOperatorFactory.java


示例10: getRecordWithTokenPagination

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
private <T> RecordPagingIterable<T> getRecordWithTokenPagination(final String endPoint, final Multimap<String, String> parameters, final Class<T> recordClass)
{
    return new RecordPagingIterable<>(new RecordPagingIterable.PagingFunction<RecordPagingIterable.TokenPage<T>>()
    {
        @Override
        public RecordPagingIterable.TokenPage<T> getNextPage(RecordPagingIterable.TokenPage<T> currentPage)
        {
            return getTokenPage(currentPage);
        }
        @Override
        public RecordPagingIterable.TokenPage<T> getFirstPage()
        {
            return getTokenPage(null);
        }

        @SuppressWarnings("unchecked")
        private RecordPagingIterable.TokenPage<T> getTokenPage(RecordPagingIterable.TokenPage page)
        {
            ImmutableListMultimap.Builder params = new ImmutableListMultimap.Builder<>();
            params.put("_method", "GET");
            Fields fields = new Fields();
            if (page != null) {
                fields.add(NEXT_PAGE_TOKEN, page.getNextPageToken());
            }
            fields.add(BATCH_SIZE, String.valueOf(batchSize));
            if (parameters != null) {
                for (String key : parameters.keySet()) {
                    //params that is passed in should overwrite default
                    fields.remove(key);
                    for (String value : parameters.get(key)) {
                        fields.add(key, value);
                    }
                }
            }
            //Let do GET Disguise in POST here to overcome Marketo URI Too long error
            FormContentProvider formContentProvider = new FormContentProvider(fields);
            MarketoResponse<T> marketoResponse = doPost(endPoint, null, params.build(), new MarketoResponseJetty92EntityReader<>(READ_TIMEOUT_MILLIS, recordClass), formContentProvider);
            return new RecordPagingIterable.TokenPage<>(marketoResponse.getResult(), marketoResponse.getNextPageToken(), marketoResponse.getNextPageToken() != null);
        }
    });
}
 
开发者ID:treasure-data,项目名称:embulk-input-marketo,代码行数:42,代码来源:MarketoRestClient.java


示例11: getParams

import org.eclipse.jetty.util.Fields; //导入依赖的package包/类
@Override
public Fields getParams() {
    return null;  //To change body of implemented methods use File | Settings | File Templates.
}
 
开发者ID:betfair,项目名称:cougar,代码行数:5,代码来源:CapturingRequest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CtThrow类代码示例发布时间:1970-01-01
下一篇:
Java ContainerStartDataProto类代码示例发布时间:1970-01-01
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap