httpClient with sdk 1.0 POST method

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

httpClient with sdk 1.0 POST method

Postby amit_shah25 » Fri Nov 14, 2008 9:54 pm

I tried using httpClient with sdk version 1.0 using https communication to login to our server.
the problem i phased is httpPost is not passing any parameters to server.

i did use BasicNameValuePair(...)

but when i try httpsURLConnection with same set of parameters, it works fine ?
does any one knows any reason why httpClient would not work ?? :cry:
amit_shah25
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Nov 14, 2008 9:50 pm

Top

Postby zenob » Mon Nov 17, 2008 4:35 pm

maybe you forgot to register https scheme ?

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. SchemeRegistry schemeRegistry = new SchemeRegistry();
  3.  
  4. schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
  5.  
  6. schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
  7.  
  8. ClientConnectionManager cm = new ThreadSafeClientConnManager(params, schemeRegistry);
  9.  
  10. httpClient = new DefaultHttpClient(cm, params);
  11.  
  12.  
  13.  
  14.  
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
User avatar
zenob
Freshman
Freshman
 
Posts: 7
Joined: Tue Mar 18, 2008 6:59 pm

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: No registered users and 6 guests