Forum OpenACS Development: Re: util_httppost

Collapse
2: Re: util_httppost (response to 1)
Posted by Gustaf Neumann on
In the naviserver world, ns_http [1] and ns_ssl [2] are the preferred interfaces, since they use directly the existing C-level socket interface (ns_ssl requires the nsssl module to be loaded).

aolserver and navisever have as well ns_httppost.

And then there are already places in OpenACS that use wget. See e.g. apm_transfer_file in acs-tcl/tcl/apm-file-procs.tcl
I'am not aware of any place that is using curl so far. Is there a good reason using curl instead of wget?

... and then there is as well ::xo::HttpRequest, which supports ssl + POST.

It would be great to cleanup here and collect the http(s)-client requests and to provide a common interface for this, checking what's available and "do the right thing". Could you help here?

Actually, util_httppost is not the best name at all. The file acs-tcl/tcl/utilities-procs.tcl defines a namespace "::util", most functions in this file use the prefix "util_", some functions are in the namespace. seems that someone left here something unfinished back. IMHO, all util_* functions should be deprecated, and be moved into ::util:: or some better namespace.

-gn

[1] https://bitbucket.org/naviserver/naviserver/src/459dfee88af56bdeccbee118013edf2be57bb402/doc/src/naviserver/ns_http.man?at=default
[2] https://bitbucket.org/naviserver/nsssl/src

Collapse
3: Re: util_httppost (response to 2)
Posted by Antonio Pisano on
Sometimes capabilities of wget and curl intersect, but wget is mostly oriented to the download of files, while curl to the upload.

First, curl allows the uploading of multiple files to web forms, and second, it supports transparently authentication, ssl and compression of the stream. This are the most important features wget lacks by my knowledge.

On the other hand, curl cannot download recursively.

My toughts on the use of curl come from this doubt: is there now an interface allowing to upload multiple files and fields, by POST or GET, to a webserver requiring authentication and using ssl and/or compression?

There is some confusion indeed about http client api, as we have the ns_*, ad_*, util_* and ::xo::* alternatives around, but (correct me if I am wrong), at the moment none of those offers all the features I mentioned.

I can of course help in revising the situation, but what would be the route you'd suggest?