Investigate the HTTP method and required parameters of Twitter API that you want to use. Then specify it. GET and POST methods are allowed. You can omit params if Twitter API doesn't require it.

callback

This module is AnyEvent::HTTP style, so you have to pass the callback (coderef).

Passed callback will be called with $header, $response, $reason and $error_response. If something is wrong with the response from Twitter API, $response will be undef. On non-2xx HTTP status code, you can get the decoded response via $error_response. So you can check the value like below.