Update: Figured out the problem, response post below. tl;dr, “Over capacity” error was a red herring - the multipart/form-data was incorrect.
Creating status updates via statuses/update.json work fine, but media uploads are consistently giving me “Over capacity” errors for every attempt, with or without post content. Posting images normally through twitter.com works, so my account hasn’t hit a quota yet. Authentication works, AFAIK.
POST contents:
-------497dd58398bfad23035dae3a3bde5b68
Content-Disposition: form-data; name="media"; filename="gb-bird3.gif"
Content-Type: image/png
Content-Transfer-Encoding: base64
R0lGODlhMAAwAKECACBGMa7EQP///////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAIALAAAAAAwADAAAAKBlAWpy+2/jkSwWjjp3VzJDm5GSJbmiabqyrbuGwbyDF8zncrczeOkvun1TLeKUEj0OY7D0rHBVP6QjCgQZc0GVFortus9gcPJcfNr5rHSxRVbKn5v3XJXGnavJbr6vXbNZhf4wtdX2KfQhviguOj4CBkpOUnJMFL5gTkhmXEJKVEAADs=
All POST options, as described by print_r ($options):
Array
(
[method] => POST
[header] => Content-type: multipart/form-data; boundary=-----497dd58398bfad23035dae3a3bde5b68
Authorization: OAuth oauth_consumer_key="xxxx", oauth_nonce="5c67193776bfe66af4bec3ee1c1aeb83c66f226a", oauth_signature="xxxx", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1433731692", oauth_token="xxxx", oauth_version="1.0"
[ignore_errors] => 1
[content] => (omitted - identical to POST contents above)
)
Response headers:
Array
(
[0] => HTTP/1.0 400 Bad Request
[content-length] => 62
[content-type] => application/json;charset=utf-8
[date] => Mon, 08 Jun 2015 02:48:07 GMT
[server] => tsa_a
[set-cookie] => guest_id=v1%3A143373168718327881; Domain=.twitter.com; Path=/; Expires=Wed, 07-Jun-2017 02:48:07 UTC
[strict-transport-security] => max-age=631138519
[vary] => Origin
[x-connection-hash] => 71c9f59a4fd6b7390d0851f5b23c943d
[x-frame-options] => SAMEORIGIN
[x-response-time] => 4
[x-xss-protection] => 1; mode=block
)
Response content:
{"errors":[{"message":"Over capacity","code":130}]}
Any ideas? Thanks in advance.