Re: New Step: p:http-get

On 7/12/07, Norman Walsh <ndw@nwalsh.com> wrote:
> / Alex Milowski <alex@milowski.org> was heard to say:
> | Rather than change p:http-request to have multiple modes of operating, I think
> | we can simplify by specializing a step to just HTTP get requests:
> |
> | <p:declare-step type="p:http-get">
>
> I'm not thrilled about the name, but p:get seems worse and that's the
> only thing I can think of.
>
> |   <p:input port="source"/>
>
> What's the input?

Sorry... that shouldn't be there.

>
> |   <p:output port="result"/>
> |   <p:option name="href" required="yes"/>
> |   <p:option name="username"/>
> |   <p:option name="password"/>
> |   <p:option name="auth-method"/>
> |   <p:option name="send-authorization"/>
> | </p:declare-step>
> |
> | The 'href' option specifies the URL to perform a GET request against.
> |
> | The 'username' etc. options control authentication just as for p:http-request.
> |
> | The result would be handled as follows:
> |
> | 1. If the result has an XML media type, the content is parsed and produced
> |    on the 'result' output port.
> |
> | 2. For non-XML media types, a c:body element is generated just as specified
> |    for p:http-request.
>
> I'm really uneasy about having p:http-request and p:http-get. It seems
> to me that either:
>
> * The get functionality should be an option of p:http-request. Or maybe it
>   should be the default behavior and the more robust behavior should be an
>   option, or
>
> * The get functionality should be an option of p:load.
>
> Having p:http-get, p:http-request, p:load, and p:document is surely at
> least one too many.
>

I put this out there because people wanted some kind of simple "http-request"
for http get requests.   I think adding a 'href' option to http-request makes
http-request difficult to specify, implement, and use.  Most importantly, having
an 'href' would require sending an empty sequence to the 'source' input
port.  I think that's a big mistake.

In the end, I'm not a big fan of p:http-get either... but I thought I'd write it
up and send it out and see what others thought.

Maybe we make p:load handle http get and add the authentication options?

-- 
--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 Thursday, 12 July 2007 13:58:17 UTC