Skip to content

Instantly share code, notes, and snippets.

@fd0
Created October 4, 2010 20:14
Show Gist options
  • Save fd0/610340 to your computer and use it in GitHub Desktop.
Save fd0/610340 to your computer and use it in GitHub Desktop.
test.cgi:
/-------------------------
#!/usr/bin/env ruby
require 'cgi'
puts "Content-Type: text/plain"
puts
cgi = CGI.new
puts cgi.params.inspect
puts cgi.query_string.inspect
\------------------------
$ curl -d foo=bar -i http://localhost:3000/cgi-bin/test.cgi?baaaa=bump
HTTP/1.1 200 OK
Content-Type: text/plain
Transfer-Encoding: chunked
Date: Mon, 04 Oct 2010 20:13:27 GMT
Server: lighttpd/1.4.28
{"foo"=>["bar"]}
"baaaa=bump"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment