Java Code Examples for org.apache.http.ProtocolVersion#compareToVersion()
The following examples show how to use
org.apache.http.ProtocolVersion#compareToVersion() .
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: ResponseProtocolCompliance.java From apigee-android-sdk with Apache License 2.0 | 6 votes |
private void requestDidNotExpect100ContinueButResponseIsOne( HttpRequest request, HttpResponse response) throws ClientProtocolException { if (response.getStatusLine().getStatusCode() != HttpStatus.SC_CONTINUE) { return; } if (!requestWasWrapped(request)) { return; } ProtocolVersion originalProtocol = getOriginalRequestProtocol((RequestWrapper) request); if (originalProtocol.compareToVersion(HttpVersion.HTTP_1_1) >= 0) { return; } if (originalRequestDidNotExpectContinue((RequestWrapper) request)) { throw new ClientProtocolException( "The incoming request did not contain a " + "100-continue header, but the response was a Status 100, continue."); } }
Example 2
Source File: ResponseProtocolCompliance.java From apigee-android-sdk with Apache License 2.0 | 5 votes |
private void transferEncodingIsNotReturnedTo1_0Client(HttpRequest request, HttpResponse response) { if (!requestWasWrapped(request)) { return; } ProtocolVersion originalProtocol = getOriginalRequestProtocol((RequestWrapper) request); if (originalProtocol.compareToVersion(HttpVersion.HTTP_1_1) >= 0) { return; } removeResponseTransferEncoding(response); }