Requests with URL object as options are broken
See original GitHub issueThe Node.js HTTP & HTTPS libraries allow to pass a new URL()
as options
. https://nodejs.org/api/https.html#https_https_request_options_callback
According to History
URL was added back in v7.5.0 and v9.3.0 allows to pass clientCertEngine
as option.
A URL object has properties like .pathname
instead of { path: ... }
and Nock does not expect these, only allows for either a string options
parameter or an object. When used with new URL()
both interceptor matching and disableNetConnect
are broken.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Max retries exceeded with URL in requests - Stack Overflow
Just use requests features: import requests from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry session = requests.
Read more >Developer Interface — Requests 2.28.1 documentation
Constructs and sends a Request . Parameters. method – method for the new Request object: GET , OPTIONS , HEAD , POST ,...
Read more >Python requests: GET Request Explained - Datagy
An HTTP GET request is used to retrieve data from the specified resource, such as a website. When using the Python requests library,...
Read more >URL objects - The Modern JavaScript Tutorial
The built-in URL class provides a convenient interface for creating and parsing URLs. There are no networking methods that require exactly a ...
Read more >fetch() - Web APIs | MDN
A string or any other object with a stringifier — including a URL object — that provides the URL of the resource you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
fixed via https://github.com/node-nock/nock/pull/1136
I think this can be closed now?