Class: DispatchServlet

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Defined in:
lib/gems/rspec-1.1.11/story_server/prototype/lib/server.rb

Instance Method Summary collapse

Instance Method Details

#do_POST(request, response) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/gems/rspec-1.1.11/story_server/prototype/lib/server.rb', line 4

def do_POST(request, response)
  File.open('story', 'w') do |io|
    io.write(request.body)
  end

  response.status = 200
  response['Content-Type'] = 'text/html'
  response.body = "body"
end