本文整理了Java中org.apache.cxf.jaxrs.client.WebClient.headers()
方法的一些代码示例,展示了WebClient.headers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.headers()
方法的具体详情如下:
包路径:org.apache.cxf.jaxrs.client.WebClient
类名称:WebClient
方法名:headers
暂无
代码示例来源:origin: org.chtijbug.drools/drools-runtime-builder
@Override
public void createBusinessModel(String businessPackage, InputStream businessModel) {
logger.debug(">> createBusinessModel(businessPackage=%s, businessModel=%s)", businessPackage, businessModel);
try {
WebClient client = WebClient.create(this.baseUrl);
MultivaluedMap<String, String> headers = new MetadataMap<>();
headers.put("slug", Arrays.asList("model.jar"));
headers.put("Authorization", Arrays.asList(auth));
headers.put("Content-Type", Arrays.asList(MediaType.APPLICATION_OCTET_STREAM));
client.headers(headers);
client.path(AssetType.MODEL.buildPath(appName, businessPackage));
client.type(MediaType.APPLICATION_OCTET_STREAM_TYPE);
client.post(IOUtils.toByteArray(businessModel));
} catch (IOException e) {
logger.error("Error while opening input Stream %s", businessModel);
throw Throwables.propagate(e);
} finally {
logger.debug("<< createBusinessModel()");
}
}
代码示例来源:origin: apache/cxf
private void invoke(int ind) throws Exception {
client.type("text/plain").accept("text/plain");
String actualHeaderName = bookHeader + ind;
String actualBookName = bookName + ind;
MultivaluedMap<String, String> map = client.getHeaders();
map.putSingle("CustomHeader", actualHeaderName);
client.headers(map).path("booksecho");
doInvoke(actualBookName, actualHeaderName);
// reset current path
client.back(true);
}
代码示例来源:origin: apache/cxf
/**
* Creates WebClient, baseURI will be set to Client currentURI
* @param client existing client
* @param inheritHeaders if existing Client headers can be inherited by new client
*/
public static WebClient fromClient(Client client, boolean inheritHeaders) {
WebClient webClient = null;
ClientState clientState = getClientState(client);
if (clientState == null) {
webClient = create(client.getCurrentURI());
if (inheritHeaders) {
webClient.headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
webClient = new WebClient(clientState.newState(client.getCurrentURI(), headers, null));
}
copyProperties(webClient, client);
return webClient;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
/**
* Creates WebClient, baseURI will be set to Client currentURI
* @param client existing client
* @param inheritHeaders if existing Client headers can be inherited by new client
*/
public static WebClient fromClient(Client client, boolean inheritHeaders) {
WebClient webClient = null;
ClientState clientState = getClientState(client);
if (clientState == null) {
webClient = create(client.getCurrentURI());
if (inheritHeaders) {
webClient.headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
webClient = new WebClient(clientState.newState(client.getCurrentURI(), headers, null));
}
copyProperties(webClient, client);
return webClient;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-rs-client
/**
* Creates WebClient, baseURI will be set to Client currentURI
* @param client existing client
* @param inheritHeaders if existing Client headers can be inherited by new client
*/
public static WebClient fromClient(Client client, boolean inheritHeaders) {
WebClient webClient = null;
ClientState clientState = getClientState(client);
if (clientState == null) {
webClient = create(client.getCurrentURI());
if (inheritHeaders) {
webClient.headers(client.getHeaders());
}
} else {
MultivaluedMap<String, String> headers = inheritHeaders ? client.getHeaders() : null;
webClient = new WebClient(clientState.newState(client.getCurrentURI(), headers, null));
}
copyProperties(webClient, client);
return webClient;
}
内容来源于网络,如有侵权,请联系作者删除!