Code example for ProtocolVersion

0
 
    private static HttpClient getClientInstance() {
    	 
        HttpParams params = new BasicHttpParams();
        HttpProtocolParams.setUserAgent(params, "mogade-android");
        HttpProtocolParams.setVersion(params, new ProtocolVersion("HTTP", 1, 1));
 
        return new DefaultHttpClient(params);
    } 
 
    private <T> Response<T> executeRequest(HttpUriRequest request, ArrayResponseConverter<T> converter) {
        BasicResponse<T> result = new BasicResponse<T>();
        HttpClient client = getClientInstance();
 
        try { 
            String responseText = client.execute(request, new BasicResponseHandler());
            JSONArray response = new JSONArray(responseText);
            result.setData(converter.convert(response));
        } catch (Exception ex) {
            ErrorMessage error = new ErrorMessage();
            error.setMessage(ex.getMessage());