That wasn't working, i had checked it too(as i said, i have tried many
things). In the following piece of code i am trying to comment on a
checkin
<checkin>
<watched type="boolean">false</watched>
<object_type>checkin</object_type>
<share_with>only me</share_with>
<tip type="boolean">false</tip>
<ratings_count type="integer">0</ratings_count>
<via>web</via>
<public type="boolean">false</public>
<creator>
<fullname>T-Rex</fullname>
<blocking_me type="boolean">false</blocking_me>
<avatar_url>
http://brightkite.com/images/
default_user_avatar.png</avatar_url>
<login>khaptman</login>
<small_avatar_url>
http://brightkite.com/images/
default_user_avatar-small.png</small_avatar_url>
<smaller_avatar_url>
http://brightkite.com/images/
default_user_avatar-smaller.png</smaller_avatar_url>
<tiny_avatar_url>
http://brightkite.com/images/
default_user_avatar-tiny.png</tiny_avatar_url>
<id>0f017c81665fba5729d2789c3bf7f58e</id>
</creator>
<is_public type="boolean">false</is_public>
<rating type="integer">0</rating>
<comments_count type="integer">0</comments_count>
<created_at_with_tz>Thursday, September 23, 2010 05:04:23Z</
created_at_with_tz>
<place>
<scope>address</scope>
<latitude type="float">24.906667</latitude>
<display_location>Karachi, Pakistan</display_location>
<longitude type="float">67.160833</longitude>
<name>Quaid-e-azam Intl</name>
<id>416ba9feae62798858c66b9cc55b5fa8</id>
</place>
<view_count type="integer">61</view_count>
<created_at_ts>1285218263.327000</created_at_ts>
<id>aa6f52d903ec8407417238a609314a2b</id>
<created_at_as_words>19 days</created_at_as_words>
<created_at type="datetime">2010-09-23T05:04:23Z</created_at>
<about type="boolean">false</about>
</checkin>
Id of this checkin is "aa6f52d903ec8407417238a609314a2b" .... when I
try to comment on it (with following code)
HttpPost request=new HttpPost("
http://brightkite.com/objects/
aa6f52d903ec8407417238a609314a2b/comments.xml");
List <NameValuePair> parameters = new
ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("comment[comment]", "xyz
comment"));
UrlEncodedFormEntity sendentity = new
UrlEncodedFormEntity(parameters, HTTP.UTF_8);
request.setEntity(sendentity);
request.setHeader("Content-Type","application/x-www-form-
urlencoded");
consumer.sign(request);
HttpResponse response=httpClient.execute(request);
int status=response.getStatusLine().getStatusCode();
System.out.println("Returned status -> "+status);
InputStream is2= response.getEntity().getContent();
for (int i = is2.read(); i > -1; i = is2.read()) {
System.out.write(i);
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I get the same error....
Returned status -> 417
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-
family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to process the request:
<PRE>
POST /objects/aa6f52d903ec8407417238a609314a2b/comments.xml HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: OAuth
oauth_token="MGNjMTFhMzFiMTExY2JjNGMzM2VmZDVh",
oauth_consumer_key="M2Y1ODYxYjI1ZDkzMmY0OGI0OGY0ZTU4",
oauth_version="1.0", oauth_signature_method="HMAC-
SHA1", oauth_timestamp="1286945372", oauth_nonce="
7549350979876047373",
oauth_signature="egZq3RGEYiCpU3ZqSBgeaGRzX%2F4%3D"
Generated Wed, 13 Oct 2010 04:48:45 GMT by gateway.csquareonline.local
(squid/2.7.STABLE6)
</ADDRESS>
</BODY></HTML>
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------