DEV Community

zaru
zaru

Posted on

Released Gem: save the request with curl

Need

When I need to maintain an application whose specification is unknown, or when the conditions for reporting bugs are inadequate, I want more information about the request.

I'm very happy with the curl command.

Usage

Add this line to your application's Gemfile:

gem 'recurl'

in Rails app:

Recurl.configure do |config|
  config.logger = Logger.new(STDOUT)
end

That's all.

Example output:

I, [2020-03-12T23:12:35.416211 #30019]  INFO -- : curl -X GET  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'  -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9'  -H 'Cookie: key=value'  'http://localhost:3000/'

Links

If you want to check out the code, it's on Github here.

To download the Gem, it's over here !

Thanks a lot for reading !

Top comments (1)

Collapse
 
ben profile image
Ben Halpern

Nice