[twitter-dev] Re: API Curl: Status update result: http_code =0!
Thx worked On 20 Jul., 20:27, Chad Etzel jazzyc...@gmail.com wrote: Ah, I think I may have an idea... You both are setting the status in the query string (more like a GET request) and setting curl_setopt($ch, CURLOPT_POST, 1). But, It doesn't look like either of you are setting a POSTFIELDS option. I gothttp_code=0sometime ago when I realized I was not sending a POST body along with a POST request. So, try setting curl_setopt(CURLOPT_POSTFIELDS, ); (yes, it's just an empty string, but it creates the content-length header in the request) and then see what happens. -Chad On Mon, Jul 20, 2009 at 11:23 AM, ldas...@schultschik.de wrote: nobody an idea?
[twitter-dev] Re: API Curl: Status update result: http_code =0!
nobody an idea?
[twitter-dev] Re: API Curl: Status update result: http_code =0!
Ah, I think I may have an idea... You both are setting the status in the query string (more like a GET request) and setting curl_setopt($ch, CURLOPT_POST, 1). But, It doesn't look like either of you are setting a POSTFIELDS option. I got http_code=0 sometime ago when I realized I was not sending a POST body along with a POST request. So, try setting curl_setopt(CURLOPT_POSTFIELDS, ); (yes, it's just an empty string, but it creates the content-length header in the request) and then see what happens. -Chad On Mon, Jul 20, 2009 at 11:23 AM, ldas...@schultschik.de wrote: nobody an idea?
[twitter-dev] Re: API Curl: Status update result: http_code =0!
I have same issue... with curl_setopt($ch, CURLOPT_POST, 1); i get this * About to connect() to twitter.com port 80 (#0) * Trying 168.143.162.100... * connected * Connected to twitter.com (168.143.162.100) port 80 (#0) * Server auth using Basic with user 'x' POST /statuses/update.xml?status=http%3A%2F%2Flocalhost%2Fent_umgebung%2Findex.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D99+adasd HTTP/1.1 Authorization: Basic x Host: twitter.com Accept: */* Content-Length: 0 Content-Type: application/x-www-form-urlencoded * Closing connection #0 * Failed to open/read local data from file/application but the tweet shows up at twitter.com --- with curl_setopt($ch, CURLOPT_POST, 0); i get this * About to connect() to twitter.com port 80 (#0) * Trying 168.143.162.116... * connected * Connected to twitter.com (168.143.162.116) port 80 (#0) * Server auth using Basic with user 'xxx' GET /statuses/update.xml?status=http%3A%2F%2Flocalhost%2Fent_umgebung%2Findex.php%3Foption%3Dcom_content%26view%3Darticle%26id%3D100+asdsd HTTP/1.1 Authorization: Basic Host: twitter.com Accept: */* HTTP/1.1 400 Bad Request Date: Thu, 16 Jul 2009 22:19:04 GMT Server: hi Last-Modified: Thu, 16 Jul 2009 22:19:04 GMT Status: 400 Bad Request X-RateLimit-Limit: 150 X-RateLimit-Remaining: 148 Pragma: no-cache Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0 Content-Type: application/xml; charset=utf-8 X-RateLimit-Reset: 1247783018 Content-Length: 256 Expires: Tue, 31 Mar 1981 05:00:00 GMT X-Revision: f4f87122b27713088b558c6b57aad4f73e83a56d X-Transaction: 1247782744-54919-16662 Set-Cookie: lang=en; path=/ Set-Cookie: _twitter_sess=BAh7CToTcGFzc3dvcmRfdG9rZW4iLWI3YmU3OTRiMDVjNzRkNmYwMWU5NmVk %250AOTc0ZWFjY2M4Y2MzNjliOWY6CXVzZXJpBCwYXwM6B2lkIiViZWQxNTkzMWZm %250AMjFiYWZlZWIwYjI3NmZmM2VlOGNmOCIKZmxhc2hJQzonQWN0aW9uQ29udHJv %250AbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D %253D--833c18afbc67a08e2c62ee0e278ac6eafb304123; domain=.twitter.com; path=/ Vary: Accept-Encoding Connection: close * Closing connection #0 and the twitter dont show up at twitter.com
[twitter-dev] Re: API Curl: Status update result: http_code =0!
So as I said when I test my script localy on my win32 it works fine I get this: Array ( [url] = http://twitter.com/statuses/update.xml?status=It%27s+made+of+a+module+and+a+profile+application [content_type] = application/xml; charset=utf-8 [http_code] = 200 [header_size] = 890 [request_size] = 246 [filetime] = -1 [ssl_verify_result] = 0 [redirect_count] = 0 [total_time] = 0.885 [namelookup_time] = 0.076 [connect_time] = 0.278 [pretransfer_time] = 0.278 [size_upload] = 0 [size_download] = 1805 [speed_download] = 2039 [speed_upload] = 0 [download_content_length] = 1805 [upload_content_length] = -1 [starttransfer_time] = 0.884 [redirect_time] = 0 ) ?xml version=1.0 encoding=UTF-8? status created_atTue Jul 14 12:06:20 + 2009/created_at id2631102072/id textIt's made of a module and a profile application/text sourcelt;a href=http://apiwiki.twitter.com/gt;APIlt;/agt;/ source truncatedfalse/truncated in_reply_to_status_id /in_reply_to_status_id in_reply_to_user_id /in_reply_to_user_id favoritedfalse/favorited in_reply_to_screen_name /in_reply_to_screen_name user id35691583/id namenordmograph/name screen_namenordmograph/screen_name locationTokyo/location description /description profile_image_urlhttp://s3.amazonaws.com/twitter_production/ profile_images/303127750/avatar_normal.png/profile_image_url urlhttp://nordmograph.com/url protectedfalse/protected followers_count47/followers_count profile_background_colorFF/profile_background_color profile_text_color33/profile_text_color profile_link_color0ba6de/profile_link_color profile_sidebar_fill_colorcc/profile_sidebar_fill_color profile_sidebar_border_colorcc/ profile_sidebar_border_color friends_count35/friends_count created_atMon Apr 27 06:56:40 + 2009/created_at favourites_count0/favourites_count utc_offset-10800/utc_offset time_zoneGreenland/time_zone profile_background_image_urlhttp://s3.amazonaws.com/ twitter_production/profile_background_images/22071817/ twitterbg_nordmograph.jpg/profile_background_image_url profile_background_tilefalse/profile_background_tile statuses_count34/statuses_count notificationsfalse/notifications verifiedfalse/verified followingfalse/following /user /status but no password to hide, I'm not sure I get what you mean, how can I give you mor infos?
[twitter-dev] Re: API Curl: Status update result: http_code =0!
OK , I was testing on a shared host I finally tested locally on a win32 with Curl and it worked fine Twitter sending back a http_code 200 on successfull tweet. Any Idea why the same script used on my host receives a http_code 0 whatever happens? Thanks a lot!
[twitter-dev] Re: API Curl: Status update result: http_code =0!
Set CURLOPT_VERBOSE option to 1, and copy / paste the output here (think to hide the auth part). 2009/7/12, nordmograph adrous...@gmail.com: Hi there , I'm new to this group, so hello everyone, I'm tryng to set my first (php) use of the twitter API using CUrl and I'm experiencing a strange behaviour: I get this http_code zero when my post has been added and also when I can't authentificate. I read a previous post on this group saying it was caused by: curl_setopt($ch, CURLOPT_POST, 1); That post said that commenting out this line (or setting to false) would fix it. But if I do so I get a good 401 for password error which makes me happy but still have a 400: errorThis method requires a POST./error when it should post fine... I can't get my 200 even if the update is posted to my twitter succesfully using that curlopt_post. Any help greatly appreciated! thks -- Arnaud Meunier Twitoaster | http://twitoaster.com
[twitter-dev] Re: API Curl: Status update result: http_code =0!
An HTTP code in cURL of 0 usually means your request is being denied by Twitter at the network equipment level. In other words, your connection is refused. This sometimes happens when the Twitter network is overloaded. On Jul 12, 2:15 am, nordmograph adrous...@gmail.com wrote: Hi there , I'm new to this group, so hello everyone, I'm tryng to set my first (php) use of the twitter API using CUrl and I'm experiencing a strange behaviour: I get this http_code zero when my post has been added and also when I can't authentificate. I read a previous post on this group saying it was caused by: curl_setopt($ch, CURLOPT_POST, 1); That post said that commenting out this line (or setting to false) would fix it. But if I do so I get a good 401 for password error which makes me happy but still have a 400: errorThis method requires a POST./error when it should post fine... I can't get my 200 even if the update is posted to my twitter succesfully using that curlopt_post. Any help greatly appreciated! thks