Java Code Examples for org.apache.http.HttpRequest#getProtocolVersion()

The following examples show how to use org.apache.http.HttpRequest#getProtocolVersion() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpRequestWarcRecord.java    From BUbiNG with Apache License 2.0 5 votes vote down vote up
private HttpRequestWarcRecord(final HeaderGroup warcHeaders, final URI targetURI, final HttpRequest request) {
	super(targetURI, warcHeaders);
	getWarcTargetURI(); // Check correct initialization
	this.warcHeaders.updateHeader(Type.warcHeader(Type.REQUEST));
	this.warcHeaders.updateHeader(new WarcHeader(WarcHeader.Name.CONTENT_TYPE, HTTP_REQUEST_MSGTYPE));
	this.protocolVersion = request.getProtocolVersion();
	this.requestLine = request.getRequestLine();
	this.setHeaders(request.getAllHeaders());
}
 
Example 2
Source File: RequestProtocolCompliance.java    From apigee-android-sdk with Apache License 2.0 5 votes vote down vote up
protected boolean requestMinorVersionIsTooHighMajorVersionsMatch(
		HttpRequest request) {
	ProtocolVersion requestProtocol = request.getProtocolVersion();
	if (requestProtocol.getMajor() != HttpVersion.HTTP_1_1.getMajor()) {
		return false;
	}

	if (requestProtocol.getMinor() > HttpVersion.HTTP_1_1.getMinor()) {
		return true;
	}

	return false;
}