Are you changing the computer clock? A 401 can occur if you’re sending a timestamp which is not synchronized with Twitter’s servers. In this case, the body of the response would have an error message indicating this.