From: Mungo Carstairs Date: Sun, 14 Dec 2014 13:45:23 +0000 (+0000) Subject: JAL-1596 set HTTP 1.1 in HttpClient X-Git-Tag: Jalview_2_9~127 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=47098a0ef82253bae397980ac63798af7249f46a;p=jalview.git JAL-1596 set HTTP 1.1 in HttpClient --- diff --git a/src/jalview/ws/HttpClientUtils.java b/src/jalview/ws/HttpClientUtils.java index 229fa4e..1bdf64f 100644 --- a/src/jalview/ws/HttpClientUtils.java +++ b/src/jalview/ws/HttpClientUtils.java @@ -29,6 +29,7 @@ import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; +import org.apache.http.HttpVersion; import org.apache.http.NameValuePair; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; @@ -40,6 +41,9 @@ import org.apache.http.entity.mime.content.FileBody; import org.apache.http.entity.mime.content.InputStreamBody; import org.apache.http.entity.mime.content.StringBody; import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.CoreProtocolPNames; +import org.apache.http.params.HttpParams; /** * Helpful procedures for working with services via HTTPClient @@ -64,7 +68,10 @@ public class HttpClientUtils List vals) throws ClientProtocolException, IOException { - HttpClient httpclient = new DefaultHttpClient(); + HttpParams params = new BasicHttpParams(); + params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, + HttpVersion.HTTP_1_1); + HttpClient httpclient = new DefaultHttpClient(params); HttpPost httppost = new HttpPost(postUrl); UrlEncodedFormEntity ue = new UrlEncodedFormEntity(vals, "UTF-8"); httppost.setEntity(ue);