[twitter-dev] Return NULL in JSON XML

2010-12-22 Thread smallbighead
There's a problem when I using twitter API about JSON response.
Here is the sample code:

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
$access_token['oauth_token'], $access_token['oauth_token_secret']);
$content = $connection-get('statuses/followers');

When I do this the response will be OK, an array of stdClass Objects.
But when I change the code into

$content = $connection-get('statuses/followers.json');
or
$content = $connection-get('statuses/followers.xml');

the response will both be NULL.
but the  $connection-http_code is 200.

Did I misuse the API or miss something?

Can someone please help me out with this ?

-smallbighead

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk


Re: [twitter-dev] Return NULL in JSON XML

2010-12-22 Thread Abraham Williams
JSON is used by default so you should be using

$content = $connection-get('statuses/followers');

Abraham
-
Abraham Williams | Hacker Advocate | abrah.am
@abraham https://twitter.com/abraham | github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.



On Wed, Dec 22, 2010 at 01:47, smallbighead smallbigh...@gmail.com wrote:

 There's a problem when I using twitter API about JSON response.
 Here is the sample code:

 $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
 $access_token['oauth_token'], $access_token['oauth_token_secret']);
 $content = $connection-get('statuses/followers');

 When I do this the response will be OK, an array of stdClass Objects.
 But when I change the code into

 $content = $connection-get('statuses/followers.json');
 or
 $content = $connection-get('statuses/followers.xml');

 the response will both be NULL.
 but the  $connection-http_code is 200.

 Did I misuse the API or miss something?

 Can someone please help me out with this ?

 -smallbighead

 --
 Twitter developer documentation and resources: http://dev.twitter.com/doc
 API updates via Twitter: http://twitter.com/twitterapi
 Issues/Enhancements Tracker:
 http://code.google.com/p/twitter-api/issues/list
 Change your membership to this group:
 http://groups.google.com/group/twitter-development-talk


-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk