當前位置: 首頁>>代碼示例>>Python>>正文


Python exceptions.RequestEntityTooLarge方法代碼示例

本文整理匯總了Python中werkzeug.exceptions.RequestEntityTooLarge方法的典型用法代碼示例。如果您正苦於以下問題:Python exceptions.RequestEntityTooLarge方法的具體用法?Python exceptions.RequestEntityTooLarge怎麽用?Python exceptions.RequestEntityTooLarge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在werkzeug.exceptions的用法示例。


在下文中一共展示了exceptions.RequestEntityTooLarge方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: parse

# 需要導入模塊: from werkzeug import exceptions [as 別名]
# 或者: from werkzeug.exceptions import RequestEntityTooLarge [as 別名]
def parse(self, stream, mimetype, content_length, options=None):
        """Parses the information from the given stream, mimetype,
        content length and mimetype parameters.

        :param stream: an input stream
        :param mimetype: the mimetype of the data
        :param content_length: the content length of the incoming data
        :param options: optional mimetype parameters (used for
                        the multipart boundary for instance)
        :return: A tuple in the form ``(stream, form, files)``.
        """
        if self.max_content_length is not None and \
           content_length is not None and \
           content_length > self.max_content_length:
            raise exceptions.RequestEntityTooLarge()
        if options is None:
            options = {}

        parse_func = self.get_parse_func(mimetype, options)
        if parse_func is not None:
            try:
                return parse_func(self, stream, mimetype,
                                  content_length, options)
            except ValueError:
                if not self.silent:
                    raise

        return stream, self.cls(), self.cls() 
開發者ID:jpush,項目名稱:jbox,代碼行數:30,代碼來源:formparser.py

示例2: _parse_urlencoded

# 需要導入模塊: from werkzeug import exceptions [as 別名]
# 或者: from werkzeug.exceptions import RequestEntityTooLarge [as 別名]
def _parse_urlencoded(self, stream, mimetype, content_length, options):
        if self.max_form_memory_size is not None and \
           content_length is not None and \
           content_length > self.max_form_memory_size:
            raise exceptions.RequestEntityTooLarge()
        form = url_decode_stream(stream, self.charset,
                                 errors=self.errors, cls=self.cls)
        return stream, form, self.cls()

    #: mapping of mimetypes to parsing functions 
開發者ID:jpush,項目名稱:jbox,代碼行數:12,代碼來源:formparser.py

示例3: in_memory_threshold_reached

# 需要導入模塊: from werkzeug import exceptions [as 別名]
# 或者: from werkzeug.exceptions import RequestEntityTooLarge [as 別名]
def in_memory_threshold_reached(self, bytes):
        raise exceptions.RequestEntityTooLarge() 
開發者ID:jpush,項目名稱:jbox,代碼行數:4,代碼來源:formparser.py


注:本文中的werkzeug.exceptions.RequestEntityTooLarge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。