def METHOD_NAME(self):
    if (self.request.get('_method') == 'DELETE'):
        return self.delete()
    s = json.dumps(self.handle_upload(), separators=(',',':'))
    redirect = self.request.get('redirect')
    if redirect:
        return self.redirect(str(
            redirect.replace('%s', urllib.quote(s, ''), 1)
        ))
    if 'application/json' in self.request.headers.get('Accept'):
        self.response.headers['Content-Type'] = 'application/json'
    self.response.write(s)