Re: p:http-request

On 5/16/07, Norman Walsh <ndw@nwalsh.com> wrote:
> I appreciate the power of the c:http-request (can we rename this
> c:request so that it's less confusing with *p*:http-request?), but
> I think it's awfully heavyweight for the simple case.
>
> Consider the earlier example in the spec:
>
> <p:http-request>
>   <p:input port="source">
>     <p:inline>
>       <c:http-request method="post" href="http://example.com/form-action">
>         <c:entity-body content-type="application/x-www-form-urlencoded">
>           <c:body>name=W3C&amp;spec=XProc</c:body>
>         </c:entity-body>
>       </c:http-request>
>     </p:inline>
>   </p:input>
> </p:http-request>
>
> I think that'd be a lot easier for users to understand if it was written
> like this:
>
> <p:http-request>
>   <p:option name="method" value="post"/>
>   <p:option name="href" value="http://example.com/form-action"/>
>   <p:option name="content-type" value="application/x-www-form-urlencoded"/>
>   <p:input port="source">
>     <p:inline>
>       <c:body>name=W3C&amp;spec=XProc</c:body>
>     </p:inline>
>   </p:input>
> </p:http-request>
>
> I suggest the following changes:
>
> 1. Make the method, href, status-only, and override-content-type values
>    of c:http-request options on the p:http-request step.
>
> 2. Make content-type an option on c:http-request
>
> 3. Make the behavior of the step dependent on what arrives on the input
>    port:
>
>    * If a c:body arrives, use it (and the options specified per 1)
>    * If a c:http-request arrives, use it (with the options specified per 1
>      serving as overrides for the values specified as attributes).
>    * If a single document with some other root element arrives, treat it
>      as a single body
>    * If a sequence arrives, treat it as multipart.
>
> 4. Rename c:http-request to c:request
>
> 5. Rename c:http-response to c:response
>
> I think this simplifies things in the simple case without sacrificing
> any functionality in the more complex cases.

I completely agree.  Thanks for the simplifications!


-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Wednesday, 16 May 2007 13:44:33 UTC