semifor/Net-Twitter — pull request #22 by sartak (2013-05-09 00:42:26+00:00)
Title: Add path_suffix option to Net::Twitter::API; tidy

Hi Marc,

I'm starting to develop a new set of APIs with Net::Twitter. It's going really well; you've done a good job in building the `twitter_api_method` abstraction.

There is one detail I need though. `twitter_api_method` universally appends `.json` to every path I'm trying to request, like so:

my $uri = URI->new($self->${ \$options{base_url_method} } . "/$local_path.json");
here ------------------------------------------------------------------- ^^^^^

The API I'm working against does not use `.json`, so I need to be able to disable that behavior. So, in my branch I've added a `path_suffix` option to `twitter_api_method` that defaults to `.json` for 100% backwards compatibility. My invocations can pass an empty string for such endpoints. Everybody wins. :)

Thanks,
Shawn