-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add file scheme #363
Comments
It's a nice idea, though I'm a bit conflicted about it. I can imagine it being a bit surprising that Did you have any thoughts on how you'd go about this? |
I haven't look at the internals of Depending on how everything is implemented, maybe the feature could be imported ad-hoc through a |
I'm happy to discuss this as a more concrete proposal, but this isn't a concrete enough proposal yet. I see only two options: turning it on unqualified, and using a different parse function. The former could be very confusing to users of the API, and you've rejected the second. |
Thanks @snoyberg . I'll try to find the time to inspect closely |
Hi there,
I'm using
req
, which is a higher level package on top ofhttp-client
. Using the former, I felt the need to be able to provide URIs withfile
scheme.My use case is to be able to mock requests during testing. In my application, the end user provides a URL which then I fetch and parse. As I trust that
req
andhttp-client
are working correctly, I think I don't need my test suite to depend on external resources that can make it non-deterministic. For that reason, I would like to be able to provide a local file URI instead of anhttp
orhttps
schema in my tests. The contents of the file would be the response body.Following the conversation in
req
(mrkkrp/req#47), the logical conclusion we have found is that, if it is considered a good idea, it should be added inhttp-client
and thenreq
adapted with the new changes.How do you see it?
The text was updated successfully, but these errors were encountered: