MCPcopy
hub / github.com/scrapy/scrapy / _set_url

Method _set_url

scrapy/http/request/__init__.py:255–266  ·  view source on GitHub ↗
(self, url: str)

Source from the content-addressed store, hash-verified

253 return self._url
254
255 def _set_url(self, url: str) -> None:
256 if not isinstance(url, str):
257 raise TypeError(f"Request url must be str, got {type(url).__name__}")
258
259 self._url = safe_url_string(url, self.encoding)
260
261 if (
262 "://" not in self._url
263 and not self._url.startswith("about:")
264 and not self._url.startswith("data:")
265 ):
266 raise ValueError(f"Missing scheme in request url: {self._url}")
267
268 @property
269 def body(self) -> bytes:

Callers 2

__init__Method · 0.95
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected