-
Notifications
You must be signed in to change notification settings - Fork 8
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
The http-request step needs to be updated #13
Comments
Follow Adam’s lead from http://expath.github.io/expath-cg/specs/http-client-2/ Probably simplifying the return type for single entity bodies. |
@Gertone is going to draft something |
Notes from the 05 Feb 2019 workshop:
|
Finally getting my head around this again. Shyed away a bit before due to the complexity multipart might impose on simple requests. Just wondering. Would it be an option to have a "http-simple-request" that could be a mandatory step and a full blown "http-request" that does all the complex stuff multipart gives. But as a consequence has a more complex interface. |
The simple request step could limit the required verbs as well.
|
This division doesn't seem like a significant improvement to me. If we wanted to divide it into two steps, I'd be more inclined to have |
Rather than divide it into two steps, what about adding an option to control response formatting, alongside the other options |
Interesting idea. What do you propose to happen when I have |
I haven't given this a whole lot of thought, but how about moving some of the request options onto the step itself; the fact that we have AVTs makes this a whole lot more practical for authors. <p:declare-step type="p:http-request">
<p:input port="source" content-types="*/*"/>
<p:output port="result" sequence="true" content-types="*/*"/>
<p:option name="serialization" as="map(xs:QName,item()*)?"/>
<p:option name="href" as="xs:string"/>
<p:option name="method" as="xs:string" select="'GET'"/>
<p:option name="timeout" as="xs:positiveInteger"/>
<p:option name="headers" as="map(xs:NCName,xs:string+)"/>
</p:declare-step> Now simple GET requests don't require any For other methods, if a That also lets us simplify the <c:request
detailed? = boolean
status-only? = boolean
username? = string
password? = string
auth-method? = string
send-authorization? = boolean
fail-on-timeout? = boolean
override-content-type? = ContentType
(c:multipart | c:body)?
</c:request> I don't think any of this reduces the implementation complexity or the number of places where we have to check for consistency in the inputs, but I'm a whole lot more concerned about having a step that's easy to use. |
Yes, that is the way I was thinking along. (With the difference of having a third map But one question:
How do you do that. Input ports have to be connected, so you have to supply a
|
One thing that concerns me about mapping multipart messages to an XProc sequence is that it doesn't seem to allow for nesting. A multipart MIME message may contain parts which are themselves multiparts. Also I'm not sure how the multipart=sequence approach would deal with the different types of multipart message (e.g. multipart/mixed, multipart/alternative, etc). Would it still allow the different subtypes of multipart to be distinguished? This is where EXPath's approach is superior (if I understand it correctly), because it doesn't over-abstract from the underlying HTTP. I use |
Conal-Tuohy said:
👍 |
Well, the EXPath approach does cover the whole complexity. It is good, but it also adds a lot of complexity to the simple cases. That is one issue to cover. |
Regarding the whitelisting of methods:, this is a bit off-topic here, but just quickly: it's not that I think a white-list is in itself restrictive, but it does validate an implementation which is restrictive. I don't believe those restrictions are necessary; I don't believe that it's significantly more difficult for an XProc implementer to support any and all HTTP methods than it is to just implement support for the most popular 3 or 4. I think, though, that if the spec mandates a certain restricted set of methods, it will, in practical terms, have the effect of restricting at least some implementations to those methods. |
Regarding the extra complexity of EXPath's approach, can we discuss this with the aid of some example? |
On editors call on 2019-10-03 we came up with this idea make response processing easier: The step get an option |
See pr #330 |
Addressed in pr #330 Closed as suggested in #330 (comment) |
The http-request response needs to be updated
Opened by: ndw on 2015-06-10, 10:21h
ndw said on 2015-06-10, 10:21h:
The current result is a c:response element with embedded possibly base64 encoded c:body element(s). If the response is multipart, we should probably now produce a sequence. Put the headers in the document-properties?
The text was updated successfully, but these errors were encountered: