class documentation

class ResponseTypes:

View In Hierarchy

Undocumented

Constant CLASSES Undocumented
Method __init__ Undocumented
Method from​_args Guess the most appropriate Response class based on the given arguments.
Method from​_body No summary
Method from​_content​_disposition Undocumented
Method from​_content​_type Return the most appropriate Response class from an HTTP Content-Type header
Method from​_filename Return the most appropriate Response class from a file name
Method from​_headers Return the most appropriate Response class by looking at the HTTP headers
Method from​_mimetype Return the most appropriate Response class for the given mimetype
Instance Variable classes Undocumented
Instance Variable mimetypes Undocumented
CLASSES: dict[str, str] =

Undocumented

Value
{'text/html': 'scrapy.http.HtmlResponse',
 'application/atom+xml': 'scrapy.http.XmlResponse',
 'application/rdf+xml': 'scrapy.http.XmlResponse',
 'application/rss+xml': 'scrapy.http.XmlResponse',
 'application/xhtml+xml': 'scrapy.http.HtmlResponse',
 'application/vnd.wap.xhtml+xml': 'scrapy.http.HtmlResponse',
 'application/xml': 'scrapy.http.XmlResponse',
...
def __init__(self):

Undocumented

def from_args(self, headers=None, url=None, filename=None, body=None):
Guess the most appropriate Response class based on the given arguments.
def from_body(self, body):
Try to guess the appropriate response based on the body content. This method is a bit magic and could be improved in the future, but it's not meant to be used except for special cases where response types cannot be guess using more straightforward methods.
def from_content_disposition(self, content_disposition):

Undocumented

def from_content_type(self, content_type, content_encoding=None):
Return the most appropriate Response class from an HTTP Content-Type header
def from_filename(self, filename):
Return the most appropriate Response class from a file name
def from_headers(self, headers):
Return the most appropriate Response class by looking at the HTTP headers
def from_mimetype(self, mimetype):
Return the most appropriate Response class for the given mimetype
classes: dict =

Undocumented

mimetypes =

Undocumented