Android HttpClient and HTTPS

This should get you started. I’m using basically the same, except with ThreadSafeClientConnManager. SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme(“https”, SSLSocketFactory.getSocketFactory(), 443)); HttpParams params = new BasicHttpParams(); SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry); HttpClient client = new DefaultHttpClient(mgr, params);

Guzzle: handle 400 bad request

As written in Guzzle official documentation: http://guzzle.readthedocs.org/en/latest/quickstart.html A GuzzleHttp\Exception\ClientException is thrown for 400 level errors if the exceptions request option is set to true For correct error handling I would use this code: use GuzzleHttp\Client; use GuzzleHttp\Exception\RequestException; try { $response = $client->get(YOUR_URL, [ ‘connect_timeout’ => 10 ]); // Here the code for successful request } … Read more