MCPcopy Create free account
hub / github.com/apify/crawlee-python / validate_http_url

Function validate_http_url

src/crawlee/_utils/urls.py:57–69  ·  view source on GitHub ↗

Validate the given HTTP URL. Args: value: The URL to validate, or `None` to skip validation. Raises: pydantic.ValidationError: If the URL is malformed or its scheme is not `http`/`https`.

(value: str | None)

Source from the content-addressed store, hash-verified

55
56
57def validate_http_url(value: str | None) -> str | None:
58 """Validate the given HTTP URL.
59
60 Args:
61 value: The URL to validate, or `None` to skip validation.
62
63 Raises:
64 pydantic.ValidationError: If the URL is malformed or its scheme is not `http`/`https`.
65 """
66 if value is not None:
67 _HTTP_URL_ADAPTER.validate_python(value)
68
69 return value
70
71
72def filter_url(

Callers 9

send_requestMethod · 0.90
streamMethod · 0.90
send_requestMethod · 0.90
streamMethod · 0.90
send_requestMethod · 0.90
streamMethod · 0.90
send_requestMethod · 0.90
test_validate_http_urlFunction · 0.90

Calls

no outgoing calls