Skip to content

Instantly share code, notes, and snippets.

@yuliabro
Created February 4, 2013 07:07
Show Gist options
  • Select an option

  • Save yuliabro/4705373 to your computer and use it in GitHub Desktop.

Select an option

Save yuliabro/4705373 to your computer and use it in GitHub Desktop.
The Common Gateway Interface (CGI) is a simple protocol for passing an HTTP request from a web server to a standalone program, and returning the output to the web browser.
=> "x=twowords&y=twowords"
>> q = "x=two+words&y=two%20words"
=> "x=two+words&y=two%20words"
>> CGI.unescape(q)
=> "x=two words&y=two words"
>> URI.unescape(q)
=> "x=two+words&y=two words"
>> CGI.unescape(q).gsub(' ', '')
=> "x=twowords&y=twowords"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment