本文整理了Java中io.vertx.ext.web.client.HttpResponse.headers()
方法的一些代码示例,展示了HttpResponse.headers()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpResponse.headers()
方法的具体详情如下:
包路径:io.vertx.ext.web.client.HttpResponse
类名称:HttpResponse
方法名:headers
暂无
代码示例来源:origin: io.vertx/vertx-rx-java
/**
* @return the headers
*/
public io.vertx.rxjava.core.MultiMap headers() {
if (cached_3 != null) {
return cached_3;
}
io.vertx.rxjava.core.MultiMap ret = io.vertx.rxjava.core.MultiMap.newInstance(delegate.headers());
cached_3 = ret;
return ret;
}
代码示例来源:origin: vert-x3/vertx-rx
/**
* @return the headers
*/
public io.vertx.rxjava.core.MultiMap headers() {
if (cached_3 != null) {
return cached_3;
}
io.vertx.rxjava.core.MultiMap ret = io.vertx.rxjava.core.MultiMap.newInstance(delegate.headers());
cached_3 = ret;
return ret;
}
代码示例来源:origin: io.vertx/vertx-consul-client
private <T> void requestString(HttpMethod method, String path, Query query, String body,
Handler<AsyncResult<T>> resultHandler,
BiFunction<String, MultiMap, T> mapper) {
request(DEFAULT_VALID_CODES, method, path, query, body, resultHandler, resp -> mapper.apply(resp.bodyAsString().trim(), resp.headers()));
}
代码示例来源:origin: io.vertx/vertx-consul-client
private <T> void requestArray(HttpMethod method, String path, Query query, String body,
Handler<AsyncResult<T>> resultHandler,
BiFunction<JsonArray, MultiMap, T> mapper) {
request(DEFAULT_VALID_CODES, method, path, query, body, resultHandler, resp -> mapper.apply(resp.bodyAsJsonArray(), resp.headers()));
}
代码示例来源:origin: io.vertx/vertx-consul-client
private <T> void requestObject(HttpMethod method, String path, Query query, String body,
Handler<AsyncResult<T>> resultHandler,
BiFunction<JsonObject, MultiMap, T> mapper) {
request(DEFAULT_VALID_CODES, method, path, query, body, resultHandler, resp -> mapper.apply(resp.bodyAsJsonObject(), resp.headers()));
}
代码示例来源:origin: silentbalanceyh/vertx-zero
/**
* Success ( 200 )
*/
private static void syncSuccess(
final HttpServerResponse response,
final HttpResponse<Buffer> clientResponse) {
final Buffer data = clientResponse.bodyAsBuffer();
// Copy header
syncSuccess(response,
clientResponse.headers(),
clientResponse.statusCode(),
clientResponse.statusMessage(),
data);
}
代码示例来源:origin: cn.vertxup/vertx-up
/**
* Success ( 200 )
*/
private static void syncSuccess(
final HttpServerResponse response,
final HttpResponse<Buffer> clientResponse) {
final Buffer data = clientResponse.bodyAsBuffer();
// Copy header
syncSuccess(response,
clientResponse.headers(),
clientResponse.statusCode(),
clientResponse.statusMessage(),
data);
}
代码示例来源:origin: io.vertx/vertx-consul-client
@Override
public ConsulClient getValuesWithOptions(String keyPrefix, BlockingQueryOptions options, Handler<AsyncResult<KeyValueList>> resultHandler) {
Query query = Query.of("recurse", true).put(options);
request(KV_VALID_CODES, HttpMethod.GET, "/v1/kv/" + urlEncode(keyPrefix), query, null, resultHandler, resp -> {
if (resp.statusCode() == HttpResponseStatus.NOT_FOUND.code()) {
return new KeyValueList();
} else {
List<KeyValue> list = resp.bodyAsJsonArray().stream().map(obj -> KVParser.parse((JsonObject) obj)).collect(Collectors.toList());
return new KeyValueList().setList(list).setIndex(Long.parseLong(resp.headers().get(INDEX_HEADER)));
}
});
return this;
}
内容来源于网络,如有侵权,请联系作者删除!