Skip to content

Instantly share code, notes, and snippets.

@fidothe
Created August 1, 2013 14:06
Show Gist options
  • Save fidothe/6131677 to your computer and use it in GitHub Desktop.
Save fidothe/6131677 to your computer and use it in GitHub Desktop.
Inchworms weirdness
require 'sinatra/base'
require 'rack/test'
class Silly
include Rack::Test::Methods
def app
Sinatra.new do
get '/', provides: :xml do
p env
env['HTTP_ACCEPT'].to_s
end
end
end
def check
p get '/', {'HTTP_ACCEPT' => 'application/xml'}
end
end
r = Silly.new.check
p r.body
p r['Content-Type']
require 'sinatra/base'
require 'rack/test'
class Silly
include Rack::Test::Methods
def app
Sinatra.new do
get '/', provides: :xml do
p env
env['HTTP_ACCEPT'].to_s
end
end
end
def check
p get '/', {}, {'HTTP_ACCEPT' => 'application/xml'}
end
end
r = Silly.new.check
p r.body
p r['Content-Type']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment