Android Google Calendar Service getting 鈥?00 Bad Request鈥?using ClientLogin

by Karim Varela » Thu, 19 May 2011 07:56:39 GMT

Sponsored Links
 I'm new to Google web services and not sure why my request is not
going through. I'm able to get my Auth token no problem using the
following code:

HttpClient client = new DefaultHttpClient();
String postURL = "";
HttpPost post = new HttpPost(postURL);
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Email",
params.add(new BasicNameValuePair("Passwd", "XXXXXX"));
params.add(new BasicNameValuePair("service", "cl"));
params.add(new BasicNameValuePair("accountType", "GOOGLE"));

UrlEncodedFormEntity ent = new
HttpResponse responsePOST = client.execute(post);
HttpEntity resEntity = responsePOST.getEntity();
if (resEntity != null) {
    String response = EntityUtils.toString(resEntity);
    authKey = response.substring( response.indexOf("Auth="),
    authKey = authKey.replace( "Auth=","" );

Then, I'm trying to make a simple call to get all the calendars for As far as I know, it should be a simple GET to making
sure to set the header as get.setHeader("Authorization", "GoogleLogin
auth=" + authKey );. This is what I have:

HttpClient client = new DefaultHttpClient();
String getURL = "
HttpGet get = new HttpGet(getURL);
get.setHeader("Authorization", "GoogleLogin auth=" + authKey );
get.setHeader("Content-Type", "application/atom+xml");
HttpResponse responseGet = client.execute(get);
HttpEntity resEntityGet = responseGet.getEntity();
if (resEntityGet != null) {
    String response = EntityUtils.toString( resEntityGet );

When this code is executed, however, I'm getting a "400 Bad Request"
and then farther down it says "Your client has issued a malformed or
illegal request." Can anybody please help me with this?


Other Threads

1. Acer Rilis Iconia, Tablet Honeycomb 4 Jutaan Mulai Besok

Untuk mereka yang tidak sabar menanti kehadiran tablet berbasis Honeycomb
seperti Motorola Xoom, Samsung Galaxy Tab 8.9 dan 10.1 ataupun LG Optimus
Pad, bersiaplah karena Acer Indonesia akan merilis tablet Acer Iconia
A500 dalam acara Acer Iconia Exhibiton di Senayan City Jakarta mulai besok
tanggal 6 April sampai 8 April 2011. Tablet yang akan di jual besok adalah
versi WiFi saja dengan model 16GB dan 32GB, tidak lupa ada promosi dengan
harga jual mulai dari 4,59 juta.

Tablet ini sudah didukung oleh prosesor dual core Nvidia Tegra 2 dengan
kecepatan 1GHz dan sudah memiliki plug in flash 10.2 yang memungkinkan untuk
menikmati akses internet tanpa batas, tentunya dengan jaringan WiFi. Acer
Iconia memiliki baterai 2 sel yang diklaim mampu tahan hingga 6 - 8 jam
untuk memutar video HD.

Berikut ini spesifikasi Acer Iconia A500 :

- Android Honeycomb 3.0
- 1GHz Dual-core Processor (NVIDIA Tegra 2 Chip)
- 10.1 inch LCD Capacitive Touchscreen dengan resolusi 1280x800 pixels
- 5MP Rear-end Camera dengan kemampuan merekam video
- 2MP untuk Video Call
- 16GB onboard storage dengan microSD support hingga 64GB
- Graphics NVIDIA GeForce
- Konektivitas - WiFi, USB connector, Micro HDMI port







2. Old uninstalled app still in My Apps?

Several months ago I installed an app called Cardio from the Market, 
then later when I chose to remove it, it did uninstall itself, I see 
no traces of it on my HTC Evo 4G, but that darned app still shows up 
under My Apps. I even tried re-installing it just to unistall it 
again, but didn't work.

Is there anyway to make this badboy go away from My Apps?


c{*filter*}tesville, va


3. How to set the size and position of an image?

4. No built-in way for adb forward to bind to the host's network interface?

5. possible to use Bitmap as notification icon?

6. Style inheritance bug in API9 and higher?

7. Is it impossible to move and merge text on an image