Are you using OAuth when you get the 401 Unauthorized error? In your signature base string, are all of those already percent-encoded entities percent-encoded again?
Example signature base string:
GET&https%3A%2F%2Fstream.twitter.com%2F1%2Fstatuses%2Ffilter.json&delimited%3Dlength%26oauth_consumer_key%3Dri8JxYK2ddwSV5xIUfNNvQ%26oauth_nonce%3D87b970ac806c7d81f902a9143595fd3f%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1324395532%26oauth_token%3D819797-RUzMC8TSS2jcNtjJwv2Yv7tsut85BVtFwSk8MuDg%26oauth_version%3D1.0%26track%3D%2523%25E5%259C%25B0%25E9%259C%2587