Closed bdr99 closed 4 years ago
When using an instance created from phin.defaults(), any options passed will persist between successive calls.
phin.defaults()
For example:
const phinInstance = phin.defaults({ url: "https://httpbin.org/get" }); await phinInstance({ method: "GET", headers: { foo: "bar" } }); await phinInstance({ method: "GET" });
Expected result: the first HTTP request should be sent with header "foo": "bar", and the second one should not.
"foo": "bar"
Actual result: both HTTP requests are sent with header "foo": "bar".
When using an instance created from
phin.defaults()
, any options passed will persist between successive calls.For example:
Expected result: the first HTTP request should be sent with header
"foo": "bar"
, and the second one should not.Actual result: both HTTP requests are sent with header
"foo": "bar"
.