示例#1
0
    def get_deserialize_handler(self, content_type):
        handlers = {
            'application/json': JSONDeserializer(),
        }

        try:
            return handlers[content_type]
        except Exception:
            raise exception.InvalidContentType(content_type=content_type)
示例#2
0
 def get_body_deserializer(self, content_type):
     try:
         return self.body_deserializers[content_type]
     except (KeyError, TypeError):
         raise exception.InvalidContentType(content_type=content_type)