Currently, Unparallel will always return the output of response.json() for every request. However, one would like just to get the status code or the HTML/text result.
Add a parameter to the up(...) to control the returned response. We could use the httpx.Response as the type for a parameter response. E.g. the default would be response=httpx.Response.json. The parameter type should be a callable and should also allow lambdas for custom control of the results.
🔈 Motivation
For example, this user wants to return True/False based on the status code. Unparallel should support this use case.
Moreover, one cannot use the supported HTTP method HEAD now because it has no JSON body. Having this feature would enable it.
🚀 Feature Request
Currently, Unparallel will always return the output of
response.json()
for every request. However, one would like just to get the status code or the HTML/text result.Add a parameter to the
up(...)
to control the returned response. We could use thehttpx.Response
as the type for a parameterresponse
. E.g. the default would beresponse=httpx.Response.json
. The parameter type should be a callable and should also allow lambdas for custom control of the results.🔈 Motivation
For example, this user wants to return True/False based on the status code. Unparallel should support this use case.
Moreover, one cannot use the supported HTTP method
HEAD
now because it has no JSON body. Having this feature would enable it.🛰 Alternatives
n/a
📎 Additional context
n/a