title: Constructing a 201 body in Tornado when collection and item handlers are separate
body: <p>In my Tornado RESTful API, I have a <code>CollectionHandler</code> at <code>/{prefix}/items/</code> with a <code>post()</code> to create a new <code>item</code> that will be placed under <code>/items/{id}</code>. When I return the <code>201</code> status code, I want to include the body of that <code>/items/{id}</code>, as constructed by <code>ItemHandler</code>'s <code>get()</code>, while not duplicating its logic. This resulted in a static method with lots of parameters:</p>
  
  <pre><code>class CollectionHandler(tornado.web.RequestHandler):
      def initialize(self):
          self.service = Service()
  
      def post(self, prefix):
          do_stuff(prefix)
          item, item_url = create_item()
          self.set_status(201)
          self.set_header('Location', item_url)
          self.write(ItemHandler.do_get(self.service, item_url, item.id))
  
  class ItemHandler(tornado.web.RequestHandler):
      def initialize(self):
          self.service = Service()
  
      @staticmethod
      def do_get(service, item_url, item_id):
          item = service.get_item(item_id)
          if not item: raise tornado.web.HTTPError(404)
          response = construct_response(item_url, item)
          return response
  
      def get(self, item_id):
          item_url = get_url(self.request)
          self.write(ItemHandler.do_get(self.service, item_url, item_id))
  </code></pre>
  
  <p>How can I clean this up? I was thinking of internally doing an HTTP request for the newly created <code>/items/{id}</code> and including the response, but there must be some better way - it might not even work because of blocking...</p>