bash notes« an older post
a newer one »Smallest transparent gif

Dump request into a tmp file

Snippet

Dump the content of an http request into a /tmp file.

file_name = '/tmp/' + params[:type].gsub(/\./, '_') + '.' + params[:api_version] + '.json'
File.open(file_name, "w+") do |f|
  f.write(request.raw_post)
end

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.