cURL to Ruby

Paste a curl command and get Ruby code using Net::HTTP — or pick any other language.

Paste a curl command above to generate code

How curl maps to Ruby (Net::HTTP)

  • →Uses Net::HTTP from the standard library — no gems needed.
  • →Values are single-quoted Ruby strings, so #{...} in a token isn't interpolated.
  • →use_ssl is switched on automatically for https URLs.

Frequently asked

How do I convert curl to Ruby?

Paste the command and pick Ruby (Net::HTTP). The request class matches the method (Net::HTTP::Post for -X POST), headers are set with request[...] and the body with request.body.

Should I use Faraday or HTTParty instead?

They're friendlier for larger apps. Net::HTTP ships with Ruby, so the converted code runs anywhere without adding a gem.

ToolNinja