-
Notifications
You must be signed in to change notification settings - Fork 6
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
HTTP requests: options #108
Comments
Hi @adamretter, do you want me to create a PR, which you can then comment on? |
Thanks for the pull requests. – According E., I have some use cases in mind in which the option will be useful. Would you mind changing it to |
@ChristianGruen regards (E). I want to actually make a suggestion for making the parsing of the request body a bit more flexible. Instead of the
Having the Instead of using an http:get('http://expath.org/xyz', map {
'parse-response': $http:parse-status,
'headers': map { 'User-Agent': 'EXPath/1.0' }
}) |
I like the suggestion!
Maybe this could simply be the response body as binary item (possibly lazy/streamable), comparable to the response you get when using
+1
If I get it right, the idea behind my initial
+1
|
TODO
|
Here is some discusson the current options set for HTTP requests.
@adamretter: If you agree with all my proposals, I’ll be glad to create a pull request.
A.
content-encoding
none
has a special meaning, because it is no supported value for theContent-Encoding
header field. I am wondering…Content-Encoding
header field. Will it be ignored, removed, or overwritten with an empty string ifnone
is supplied?B.
transfer-encoding
none
: Same here…chunked
is not supported by HTTP/2 anymore, so I’ll include it in the error check.http:invalid-option
instead ofhttp:version
(the attached error message should be explanatory enough, and it basically falls into the same category).C.
follow-redirect
true
. I liked this default, maybe we can keep it.http
tohttps
won’t be resolved. I don’t know what the Apache HTTP Client does, or if/how redirects were handled in the Java implementation of the EXPath HTTP Client?D.
timeout
0
, which stands for “no timeout”. Maybe it’s best to adopt this default? And an error could be raised if a negative value is supplied.E.
parse-response-entity-body
parse-response
is ambiguous; on the other hand, I assume that people who use this option will know what it does anyway. A possible alternative:parse-bodies
: Only responses are “parsed” (requests are serialized), and the plural form indicates that we may have multiple bodies in a response. What do you think?The text was updated successfully, but these errors were encountered: