本文整理了Java中org.jboss.netty.handler.codec.http.HttpResponse.getHeaderNames()
方法的一些代码示例,展示了HttpResponse.getHeaderNames()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpResponse.getHeaderNames()
方法的具体详情如下:
包路径:org.jboss.netty.handler.codec.http.HttpResponse
类名称:HttpResponse
方法名:getHeaderNames
暂无
代码示例来源:origin: net.anthavio/hatatitla
System.out.println();
if (!response.getHeaderNames().isEmpty()) {
for (String name : response.getHeaderNames()) {
for (String value : response.getHeaders(name)) {
System.out.println("HEADER: " + name + " = " + value);
代码示例来源:origin: org.jboss.ws.native/jbossws-native-core
metadata.put(NettyClient.RESPONSE_CODE_MESSAGE, responseStatus.getReasonPhrase());
Map<String, Object> responseHeaders = result.getResponseHeaders();
for (String headerName : response.getHeaderNames())
代码示例来源:origin: com.couchbase.client/couchbase-client
private void logResponse(HttpResponse response) {
finerLog("STATUS: " + response.getStatus());
finerLog("VERSION: " + response.getProtocolVersion());
if (!response.getHeaderNames().isEmpty()) {
for (String name : response.getHeaderNames()) {
for (String value : response.getHeaders(name)) {
finerLog("HEADER: " + name + " = " + value);
}
}
finerLog(System.getProperty("line.separator"));
}
if (response.getStatus().getCode() == 200 && response.isChunked()) {
readingChunks = true;
finerLog("CHUNKED CONTENT {");
} else if(response.getStatus().getCode() == 200) {
ChannelBuffer content = response.getContent();
if (content.readable()) {
finerLog("CONTENT {");
finerLog(content.toString(CharsetUtil.UTF_8));
finerLog("} END OF CONTENT");
}
} else {
throw new ConnectionException("Could not retrieve configuration chunk. "
+ "Response Code is: " + response.getStatus());
}
}
内容来源于网络,如有侵权,请联系作者删除!