Skip to content

Instantly share code, notes, and snippets.

@rafacv
Created December 13, 2011 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafacv/1473920 to your computer and use it in GitHub Desktop.
Save rafacv/1473920 to your computer and use it in GitHub Desktop.
Code to get a hanging post request on windows using webrick over ironruby.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>
$(function () {
$("#myb").click(function () {
$.ajax({
url: "/showme",
type: "POST",
data: {nome: "Jose", sobrenome: "Valim"},
success: function (data) {
$("body").append("<p>" + data + "</p>");
}
});
});
});
</script>
</head>
<body>
<input id="myb" type="button" value="Click me">
</body>
</html>
require "sinatra"
set :port, 5678
set :views, File.expand_path(".")
get "/" do
erb :index
end
post "/showme" do
"#{request.env.inspect}\n#{params.inspect}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment