本文整理了Java中io.netty.handler.codec.http.HttpResponse.getProtocolVersion()
方法的一些代码示例,展示了HttpResponse.getProtocolVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpResponse.getProtocolVersion()
方法的具体详情如下:
包路径:io.netty.handler.codec.http.HttpResponse
类名称:HttpResponse
方法名:getProtocolVersion
暂无
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
protected void captureResponseHeaderSize(HttpResponse httpResponse) {
String statusLine = httpResponse.getProtocolVersion().toString() + ' ' + httpResponse.getStatus().toString();
// +2 => CRLF after status line, +4 => header/data separation
long responseHeadersSize = statusLine.length() + 6;
HttpHeaders headers = httpResponse.headers();
responseHeadersSize += BrowserMobHttpUtil.getHeaderSize(headers);
harEntry.getResponse().setHeadersSize(responseHeadersSize);
}
代码示例来源:origin: JZ-Darkal/AndroidHttpCapture
protected void captureResponse(HttpResponse httpResponse) {
HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text());
harEntry.setResponse(response);
captureResponseHeaderSize(httpResponse);
captureResponseMimeType(httpResponse);
if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) {
captureResponseCookies(httpResponse);
}
if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) {
captureResponseHeaders(httpResponse);
}
if (BrowserMobHttpUtil.isRedirect(httpResponse)) {
captureRedirectUrl(httpResponse);
}
}
代码示例来源:origin: com.netflix.rxnetty/rx-netty
@Override
public HttpVersion getProtocolVersion() {
return headers.getProtocolVersion();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4
@Override
public String getProtocolText() {
return response.getProtocolVersion().text();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4
@Override
public String getProtocolName() {
return response.getProtocolVersion().protocolName();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4-provider
@Override
public String getProtocolName() {
return response.getProtocolVersion().protocolName();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4-provider
@Override
public int getProtocolMinorVersion() {
return response.getProtocolVersion().minorVersion();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4
@Override
public int getProtocolMajorVersion() {
return response.getProtocolVersion().majorVersion();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4
@Override
public int getProtocolMinorVersion() {
return response.getProtocolVersion().minorVersion();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4-provider
@Override
public int getProtocolMajorVersion() {
return response.getProtocolVersion().majorVersion();
}
代码示例来源:origin: org.asynchttpclient/async-http-client-netty4-provider
@Override
public String getProtocolText() {
return response.getProtocolVersion().text();
}
代码示例来源:origin: net.lightbody.bmp/littleproxy
/**
* Duplicates the status line and headers of an HttpResponse object. Does not duplicate any content associated with that response.
*
* @param originalResponse HttpResponse to be duplicated
* @return a new HttpResponse with the same status line and headers
*/
public static HttpResponse duplicateHttpResponse(HttpResponse originalResponse) {
DefaultHttpResponse newResponse = new DefaultHttpResponse(originalResponse.getProtocolVersion(), originalResponse.getStatus());
newResponse.headers().add(originalResponse.headers());
return newResponse;
}
代码示例来源:origin: com.github.mike10004/littleproxy
/**
* Duplicates the status line and headers of an HttpResponse object. Does not duplicate any content associated with that response.
*
* @param originalResponse HttpResponse to be duplicated
* @return a new HttpResponse with the same status line and headers
*/
public static HttpResponse duplicateHttpResponse(HttpResponse originalResponse) {
DefaultHttpResponse newResponse = new DefaultHttpResponse(originalResponse.getProtocolVersion(), originalResponse.getStatus());
newResponse.headers().add(originalResponse.headers());
return newResponse;
}
代码示例来源:origin: io.reactivex/rxnetty
public HttpClientResponse(HttpResponse nettyResponse, UnicastContentSubject<T> content) {
super(content);
this.nettyResponse = nettyResponse;
httpVersion = this.nettyResponse.getProtocolVersion();
status = this.nettyResponse.getStatus();
responseHeaders = new HttpResponseHeaders(nettyResponse);
cookiesHolder = CookiesHolder.newClientResponseHolder(nettyResponse.headers());
}
代码示例来源:origin: com.netflix.rxnetty/rx-netty
public HttpClientResponse(HttpResponse nettyResponse, UnicastContentSubject<T> content) {
super(content);
this.nettyResponse = nettyResponse;
httpVersion = this.nettyResponse.getProtocolVersion();
status = this.nettyResponse.getStatus();
responseHeaders = new HttpResponseHeaders(nettyResponse);
cookiesHolder = CookiesHolder.newClientResponseHolder(nettyResponse.headers());
}
代码示例来源:origin: misakuo/Dream-Catcher
protected void captureResponseHeaderSize(HttpResponse httpResponse) {
Log.e("InnerHandle", "captureResponseHeaderSize " + harEntry.getId());
String statusLine = httpResponse.getProtocolVersion().toString() + ' ' + httpResponse.getStatus().toString();
// +2 => CRLF after status line, +4 => header/data separation
long responseHeadersSize = statusLine.length() + 6;
HttpHeaders headers = httpResponse.headers();
responseHeadersSize += BrowserMobHttpUtil.getHeaderSize(headers);
harResponse.getResponse().setHeadersSize(responseHeadersSize);
}
代码示例来源:origin: net.lightbody.bmp/browsermob-core
protected void captureResponseHeaderSize(HttpResponse httpResponse) {
String statusLine = httpResponse.getProtocolVersion().toString() + ' ' + httpResponse.getStatus().toString();
// +2 => CRLF after status line, +4 => header/data separation
long responseHeadersSize = statusLine.length() + 6;
HttpHeaders headers = httpResponse.headers();
responseHeadersSize += BrowserMobHttpUtil.getHeaderSize(headers);
harEntry.getResponse().setHeadersSize(responseHeadersSize);
}
代码示例来源:origin: net.lightbody.bmp/browsermob-core-littleproxy
protected void captureResponseHeaderSize(HttpResponse httpResponse) {
String statusLine = httpResponse.getProtocolVersion().toString() + ' ' + httpResponse.getStatus().toString();
// +2 => CRLF after status line, +4 => header/data separation
long responseHeadersSize = statusLine.length() + 6;
HttpHeaders headers = httpResponse.headers();
responseHeadersSize += BrowserMobHttpUtil.getHeaderSize(headers);
harEntry.getResponse().setHeadersSize(responseHeadersSize);
}
代码示例来源:origin: net.lightbody.bmp/browsermob-core
protected void captureResponse(HttpResponse httpResponse) {
HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text());
harEntry.setResponse(response);
captureResponseHeaderSize(httpResponse);
captureResponseMimeType(httpResponse);
if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) {
captureResponseCookies(httpResponse);
}
if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) {
captureResponseHeaders(httpResponse);
}
if (BrowserMobHttpUtil.isRedirect(httpResponse)) {
captureRedirectUrl(httpResponse);
}
}
代码示例来源:origin: net.lightbody.bmp/browsermob-core-littleproxy
protected void captureResponse(HttpResponse httpResponse) {
HarResponse response = new HarResponse(httpResponse.getStatus().code(), httpResponse.getStatus().reasonPhrase(), httpResponse.getProtocolVersion().text());
harEntry.setResponse(response);
captureResponseHeaderSize(httpResponse);
captureResponseMimeType(httpResponse);
if (dataToCapture.contains(CaptureType.RESPONSE_COOKIES)) {
captureResponseCookies(httpResponse);
}
if (dataToCapture.contains(CaptureType.RESPONSE_HEADERS)) {
captureResponseHeaders(httpResponse);
}
if (BrowserMobHttpUtil.isRedirect(httpResponse)) {
captureRedirectUrl(httpResponse);
}
}
内容来源于网络,如有侵权,请联系作者删除!