Code example for BasicHttpParams

Methods: setParameter

0
        } 
    } 
 
    protected @Nonnull HttpClient getClient() {
        boolean ssl = hue.getAPIEndpoint().startsWith("https");
        HttpParams params = new BasicHttpParams();
 
        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
        //noinspection deprecation 
        HttpProtocolParams.setContentCharset(params, HTTP.UTF_8);
        HttpProtocolParams.setUserAgent(params, "Imaginary Home");
 
        Properties p = hue.getCustomProperties();
        String proxyHost = p.getProperty("proxyHost");
        String proxyPort = p.getProperty("proxyPort");
 
        if( proxyHost != null ) {
            int port = 0;
 
            if( proxyPort != null && proxyPort.length() > 0 ) {
                port = Integer.parseInt(proxyPort);
            } 
            params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(proxyHost, port, ssl ? "https" : "http"));
        } 
        return new DefaultHttpClient(params);
    } 
 
    public JSONObject post(@Nonnull String resource, JSONObject body) throws HueException {
Connect your IDE to all the code out there  Get Codota for Java