Code example for AndroidHttpClient

Methods: close, execute

2
                HttpPost post = new HttpPost(url);
                StringEntity se = new StringEntity(json[0]);
                post.setEntity(se);
                post.setHeader("Accept", "application/json");
                post.setHeader("Content-type", "application/json");
                return http.execute(post);
            } catch (Exception e) {
                e.printStackTrace();
                return null; 
            } finally { 
                http.close();
            } 
        } 
 
        protected void onPostExecute(HttpResponse response) {
            if (response != null) {
                try { 
                    String response_text =           convertStreamToString(response.getEntity().getContent());
                    Log.d(TAG, response_text);
                    Toast.makeText(getApplicationContext(), response_text, Toast.LENGTH_LONG).show();
                } catch (IOException e) {