コード例 #1
0
ファイル: errors.py プロジェクト: teodoryantcheff/OSPy
 def __init__(self):
     status = status = HTTP_STATUS_CODES[406]
     headers = {
         'Cache-Control': 'no-cache',
         'Content-Type': 'application/json'
     }
     HTTPError.__init__(self, status, headers, self.message)
コード例 #2
0
  def __init__(self, url, status='303 See Other'):
    """
    Returns a `status` redirect to the new URL. 
    `url` is joined with the base URL so that things like 
    `redirect("about") will work properly.
    """
    newloc = urlparse.urljoin(web.ctx.path, url)

    newloc = ctx.homedomain + newloc

    headers = {
      'Content-Type': 'text/html',
      'Location': newloc
    }
    HTTPError.__init__(self, status, headers, "")
コード例 #3
0
ファイル: http_response.py プロジェクト: BakaRei/pyprint
 def __init__(self):
     status = "201 Created"
     headers = {'Content-Type': 'application/json'}
     HTTPError.__init__(self, status, headers, self.message)
コード例 #4
0
ファイル: http_response.py プロジェクト: BakaRei/pyprint
 def __init__(self):
     status = "403 Forbidden"
     headers = {'Content-Type': 'application/json'}
     HTTPError.__init__(self, status, headers, self.message)
コード例 #5
0
ファイル: http_response.py プロジェクト: BakaRei/pyprint
 def __init__(self):
     status = "401 Unauthorized"
     headers = {'Content-type': 'application/json'}
     HTTPError.__init__(self, status, headers, self.message)
コード例 #6
0
ファイル: http_response.py プロジェクト: BakaRei/pyprint
 def __init__(self):
     status = "401 Bad Request"
     headers = {'Content-type': 'application/json'}
     HTTPError.__init__(self, status, headers, self.message)
コード例 #7
0
ファイル: responses.py プロジェクト: maparco/numenta-apps
 def __init__(self, message=None):
   status = "405 Method Not Allowed"
   headers = {
     "Content-Type": "application/json; charset=UTF-8"
   }
   HTTPError.__init__(self, status, headers, jsonEncode(message or self.message))
コード例 #8
0
ファイル: httpstatus.py プロジェクト: five3/WTP
 def __init__(self, status, message=None):
     headers = {'Content-Type': 'text/html'}
     HTTPError.__init__(self, status, headers, message or self.message)
 def __init__(self, message=None):
     status = "405 Method Not Allowed"
     headers = {"Content-Type": "application/json; charset=UTF-8"}
     HTTPError.__init__(self, status, headers,
                        encodeJson(message or self.message))
コード例 #10
0
ファイル: responses.py プロジェクト: darian19/what
 def __init__(self, message=None):
   status = "403 Forbidden"
   headers = {
     "Content-Type": "application/json; charset=UTF-8"
   }
   HTTPError.__init__(self, status, headers, encodeJson(message or self.message))
 def __init__(self, message=None):
   status = "400 Bad Request"
   headers = {
     "Content-Type": "application/json; charset=UTF-8"
   }
   HTTPError.__init__(self, status, headers, jsonEncode(message or self.message))
コード例 #12
0
 def __init__(self, log_message=None):
     HTTPError.__init__(self, 400, log_message)
コード例 #13
0
 def __init__(self, message):
     status = '500 Internal Server Error'
     headers = {'Content-Type': 'text/html'}
     HTTPError.__init__(self, status, headers, message)
コード例 #14
0
ファイル: internalerror.py プロジェクト: UCL-INGI/INGInious
 def __init__(self, message):
     status = '500 Internal Server Error'
     headers = {'Content-Type': 'text/html'}
     HTTPError.__init__(self, status, headers, message)
コード例 #15
0
ファイル: validators.py プロジェクト: wmark/anzu
 def __init__(self, log_message=None):
     HTTPError.__init__(self, 400, log_message)