本文整理了Java中com.ning.http.client.Response.hasResponseHeaders
方法的一些代码示例,展示了Response.hasResponseHeaders
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.hasResponseHeaders
方法的具体详情如下:
包路径:com.ning.http.client.Response
类名称:Response
方法名:hasResponseHeaders
[英]Return true if the response's headers has been computed by an AsyncHandler It will return false if the either AsyncHandler#onStatusReceived(HttpResponseStatus) or AsyncHandler#onHeadersReceived(HttpResponseHeaders) returned AsyncHandler.STATE#ABORT
[中]返回true如果响应的头由AsyncHandler计算,那么如果AsyncHandler#onStatusReceived(HttpResponseStatus)或AsyncHandler#onHeadersReceived(HttpResponseHeaders)返回AsyncHandler,则返回false。州#中止
代码示例来源:origin: com.ning/async-http-client
public boolean hasResponseHeaders() {
return response.hasResponseHeaders();
}
代码示例来源:origin: outbrain/ob1k
@Override
public boolean hasResponseHeaders() {
return ningResponse.hasResponseHeaders();
}
代码示例来源:origin: javaee/grizzly-ahc
public boolean hasResponseHeaders() {
return response.hasResponseHeaders();
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-client
public boolean hasResponseHeaders() {
return response.hasResponseHeaders();
}
代码示例来源:origin: io.gatling/async-http-client
public boolean hasResponseHeaders() {
return response.hasResponseHeaders();
}
代码示例来源:origin: org.mule.services/mule-service-http
public HttpResponse create(Response response, InputStream inputStream) throws IOException {
HttpResponseBuilder responseBuilder = HttpResponse.builder();
responseBuilder.statusCode(response.getStatusCode());
responseBuilder.reasonPhrase(response.getStatusText());
String contentType = response.getHeader(HEADER_CONTENT_TYPE);
String contentLength = response.getHeader(HEADER_CONTENT_LENGTH);
responseBuilder.entity(createEntity(inputStream, contentType, contentLength));
if (response.hasResponseHeaders()) {
for (Entry<String, List<String>> headerEntry : response.getHeaders().entrySet()) {
responseBuilder.addHeaders(headerEntry.getKey(), headerEntry.getValue());
}
}
return responseBuilder.build();
}
代码示例来源:origin: org.mule.modules/mule-module-http
private HttpResponse createMuleResponse(Response response, InputStream inputStream) throws IOException
{
HttpResponseBuilder responseBuilder = new HttpResponseBuilder();
responseBuilder.setStatusCode(response.getStatusCode());
responseBuilder.setReasonPhrase(response.getStatusText());
responseBuilder.setEntity(new InputStreamHttpEntity(inputStream));
if (response.hasResponseHeaders())
{
for (String header : response.getHeaders().keySet())
{
for (String headerValue : response.getHeaders(header))
{
responseBuilder.addHeader(header, headerValue);
}
}
}
return responseBuilder.build();
}
内容来源于网络,如有侵权,请联系作者删除!