class documentation

class ResponseTypes: (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method from_args Guess the most appropriate Response class based on the given arguments.
Method from_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.
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
Constant CLASSES Undocumented
Instance Variable classes Undocumented
Instance Variable mimetypes Undocumented
def __init__(self): (source)

Undocumented

def from_args(self, headers=None, url=None, filename=None, body=None): (source)

Guess the most appropriate Response class based on the given arguments.

def from_body(self, body): (source)

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): (source)

Undocumented

def from_content_type(self, content_type, content_encoding=None): (source)

Return the most appropriate Response class from an HTTP Content-Type header

def from_filename(self, filename): (source)

Return the most appropriate Response class from a file name

def from_headers(self, headers): (source)

Return the most appropriate Response class by looking at the HTTP headers

def from_mimetype(self, mimetype): (source)

Return the most appropriate Response class for the given mimetype

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',
...

Undocumented

mimetypes = (source)

Undocumented