Hi Johan,
the HTTP Module is pretty magic, because it automatically tries to
convert the input to the expected result format. This makes it
difficult to stream.
We have already pondered two options to circumvent this restriction:
* Fetch Module: extend the function signatures with additional options
* HTTP Module (our favorite): add additional functions (e.g.
http:get(), http:post(), etc.) with xs:base64 as return type.
Which options of the HTTP Module do you currently use?
Christian
______________________________
> _______________________________________________
On Thu, Mar 27, 2014 at 1:06 PM, Johan Mörén <hutchkintoot@gmail.com> wrote:
> Hi
>
> I have built a small client in XQuery that fetches zip files from another
> remote service using the http-module and stores them on disk with the help
> of the file-module.
>
> Some of the returned zip files are really large and BaseX seems to need to
> materialize the files in memory before writing them to disk resulting in out
> of memory errors for some files.
>
> Is there some way read the response in a more streamable fashion when using
> the http-module?
>
> I tried using the fetch:binary function successfully but i really need the
> more extended functionality of the http-module.
>
> #results in out of memory if the zip file is too large
> file:write-binary("file.zip", http:sendrequest(...)[2])
>
> #works all the time.
> file:write-binary("file.zip", fetch:binary(...))
>
> Regards,
> Johan
>
>
>
>
>
>
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>