Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public static DefaultHttpClient httpClient;
  2.  
  3. URL url=new URL(urlToHit);
  4. LoginScreen.httpClient = new DefaultHttpClient(); //LoginScreen is the name of the current Activity
  5.  
  6. HttpPost httppost = new HttpPost(url.toString());
  7. HttpResponse response = LoginScreen.httpClient.execute(httppost);
  8.  
  9. xr.parse(new InputSource(url.openStream())); //SAX parsing
  10.  
  11. URL url=new URL(urlToHit);
  12.  
  13. HttpPost httppost = new HttpPost(url.toString());
  14. HttpResponse response = LoginScreen.httpClient.execute(httppost);
  15.  
  16. // Log.v("response code",""+response.getStatusLine().getStatusCode());
  17.  
  18. // Get hold of the response entity
  19. HttpEntity entity = response.getEntity();
  20.  
  21. InputStream instream = null;
  22.  
  23. if (entity != null) {
  24. instream = entity.getContent();
  25. }
  26.  
  27. xr.parse(new InputSource(instream)); //SAX parsing
Add Comment
Please, Sign In to add comment