Dear Ron, There has indeed been a substantial change in the way how http:send-request works; it’s now based on the contemporary Java HTTP Client API, which provides a better overall performance [1]. We’ll additionally mention that in the article on the HTTP Client Module.
It should yield the same results as the old implementation, though; so thanks for your example, we’ll see what we can do. We’ll keep you updated. Christian [1] https://docs.basex.org/wiki/BaseX_10#HTTP_Requests On Thu, Aug 4, 2022 at 4:42 PM Ron Van den Branden <ron.vdbran...@gmail.com> wrote: > > Hi, > > After upgrading BaseX to 10.0 (yay!), I notice how http:send-request() calls > that used to work in 9.7 are now failing. I didn't find any changes > documented between version 9.7 and 10.0 at > https://docs.basex.org/wiki/HTTP_Client_Module. Yet (tested with the same > JDK), I'm observing differences between BaseX-9.7 and BaseX-10.0. > > Test case: > > let $uri := 'http://vocab.getty.edu/aat/300027473.rdf' > return http:send-request(<http:request method="get" status-only="true" > href="{$uri}"/>) > > Result: > > BaseX-9.7: valid response > > <http:response xmlns:http="http://expath.org/ns/http-client" status="200" > message="OK"> > <http:header name="Server" value="Apache-Coyote/1.1"/> > <http:header name="Content-Disposition" value="attachment; > filename="aat_300027473.rdf""/> > <http:header name="Set-Cookie" > value="BIGipServerForest=!VhOKP5OjryEOuPhyk3Vb4l5ey77Ecb9C7h36RwDl7h0P+12yggqrxtSz6mEpwv8Du1qdIeJTRfFkqw==; > path=/; Httponly"/> > <http:header name="Content-Length" value="55888"/> > <http:header name="Date" value="Thu, 04 Aug 2022 14:32:02 GMT"/> > <http:header name="Content-Type" value="application/rdf+xml;charset=UTF-8"/> > <http:body media-type="application/rdf+xml"/> > </http:response> > > BaseX-10.0: "Bad Request" error > > <http:response xmlns:http="http://expath.org/ns/http-client" status="400" > message="Bad Request"> > <http:header name="connection" value="close"/> > <http:header name="content-length" value="968"/> > <http:header name="content-type" value="text/html;charset=utf-8"/> > <http:header name="date" value="Thu, 04 Aug 2022 14:31:56 GMT"/> > <http:header name="server" value="Apache-Coyote/1.1"/> > <http:header name="set-cookie" > value="BIGipServerForest=!mBtphfxjdsqnz+Vyk3Vb4l5ey77EcVUpOTC6kqayu7tj3BpCNxN68oQTs+W4wrEO4+vQ2pECmIF6rA==; > path=/; Httponly"/> > <http:body media-type="text/html"/> > </http:response> > > The same results are obtained with fetch:xml() (BaseX-9.7 - valid response) > and fetch:doc() (BaseX-10.0 - bad request). > > Apologies if I'm overlooking the obvious, but has anything changed w.r.t. > these http / fetch module functions or their underlying methods of network > access that would require changes in my XQuery code or BaseX-10.0 > configuration? > > Best, > > Ron