Class: Bender::HTTP::Parrot

Inherits:
BaseServlet
  • Object
show all
Defined in:
servlets/parrot.rb

Overview

Description:

a simple ping endpoint
Dependencies

none

Configuration

none

Authors

Michael Heijmans ([email protected])

Instance Attribute Summary

Attributes inherited from BaseServlet

#auth_token, #bot, #config, #options, #server

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseServlet

#initialize, #params

Constructor Details

This class inherits a constructor from Bender::BaseServlet

Class Method Details

.mountpointObject


35
36
37
# File 'servlets/parrot.rb', line 35

def self.mountpoint
  "/parrot"
end

Instance Method Details

#do_GET(request, response) ⇒ Object


16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'servlets/parrot.rb', line 16

def do_GET(request, response)
  status = 200
  content_type = "text/html"
  body = []

  body << "Params:"
  params(request).each do |k, v|
    body << "#{k} = #{v}"
  end
  body = body.join("<br/>")
  body += "\n"

  response.status = status
  response['Content-Type'] = content_type
  response.body = body
  response.body = body

end