You are using the old version (1) of the Twitter API, make sure you use the correct endpoints, for example:
https://api.twitter.com/1.1/statuses/update.json
(also note that it is preferred to send the oAuth details as Authentication headers, but it should work regardless of which way you do this)