class documentation

class Request(object_ref):

Known subclasses: scrapy.http.request.form.FormRequest, scrapy.http.request.json_request.JsonRequest, scrapy.http.request.rpc.XmlRpcRequest

View In Hierarchy

Undocumented

Class Method from​_curl No summary
Method __init__ Undocumented
Method __str__ Undocumented
Method ​_get​_body Undocumented
Method ​_get​_url Undocumented
Method ​_set​_body Undocumented
Method ​_set​_url Undocumented
Method copy Return a copy of this Request
Method replace Create a new Request with the same attributes except for those given new values.
Class Variable body Undocumented
Class Variable url Undocumented
Instance Variable ​_body Undocumented
Instance Variable ​_cb​_kwargs Undocumented
Instance Variable ​_encoding Undocumented
Instance Variable ​_meta Undocumented
Instance Variable ​_url Undocumented
Instance Variable callback Undocumented
Instance Variable cookies Undocumented
Instance Variable dont​_filter Undocumented
Instance Variable errback Undocumented
Instance Variable flags Undocumented
Instance Variable headers Undocumented
Instance Variable method Undocumented
Instance Variable priority Undocumented
Property cb​_kwargs Undocumented
Property encoding Undocumented
Property meta Undocumented

Inherited from object_ref:

Method __new__ Undocumented
Class Variable __slots__ Undocumented
@classmethod
def from_curl(cls, curl_command, ignore_unknown_options=True, **kwargs):

Create a Request object from a string containing a cURL command. It populates the HTTP method, the URL, the headers, the cookies and the body. It accepts the same arguments as the Request class, taking preference and overriding the values of the same arguments contained in the cURL command.

Unrecognized options are ignored by default. To raise an error when finding unknown options call this method by passing ignore_unknown_options=False.

Caution

Using from_curl from ~scrapy.http.Request subclasses, such as ~scrapy.http.JSONRequest, or ~scrapy.http.XmlRpcRequest, as well as having :ref:`downloader middlewares <topics-downloader-middleware>` and :ref:`spider middlewares <topics-spider-middleware>` enabled, such as ~scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware, ~scrapy.downloadermiddlewares.useragent.UserAgentMiddleware, or ~scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware, may modify the ~scrapy.http.Request object.

To translate a cURL command into a Scrapy request, you may use curl2scrapy.

def __init__(self, url, callback=None, method='GET', headers=None, body=None, cookies=None, meta=None, encoding='utf-8', priority=0, dont_filter=False, errback=None, flags=None, cb_kwargs=None):
def __str__(self):

Undocumented

def _get_body(self):

Undocumented

def _get_url(self):

Undocumented

def _set_body(self, body):

Undocumented

def _set_url(self, url):

Undocumented

def copy(self):
Return a copy of this Request
def replace(self, *args, **kwargs):
Create a new Request with the same attributes except for those given new values.
body =

Undocumented

url =

Undocumented

_body: bytes =

Undocumented

_cb_kwargs =

Undocumented

_encoding =

Undocumented

_meta =

Undocumented

_url =

Undocumented

callback =

Undocumented

cookies =

Undocumented

dont_filter =

Undocumented

errback =

Undocumented

flags =

Undocumented

headers =

Undocumented

method =

Undocumented

priority =

Undocumented

@property
cb_kwargs =

Undocumented

@property
encoding =

Undocumented

@property
meta =

Undocumented