Re: [basex-talk] RESTXQ Custom Multipart Response

2023-10-29 Thread Christian Grün
Hi Jean-Marc,

For the time being, I’m sorry multipart support is only available for
requests (multipart/mixed [1], multipart/form-data [2]). Responses are
limited to single parts (multipart data has not been considered in the
RESTXQ specification).

I have added a clarifying comment to our documentation.

Best,
Christian

[1] https://docs.basex.org/wiki/RESTXQ#Multipart_Types
[2] https://docs.basex.org/wiki/RESTXQ#HTML_Form_Fields


On Sun, Oct 29, 2023 at 8:21 AM Jean-Marc ANSEL  wrote:

> Hello,
>
> I'm trying to do a custom multipart response with basex RESTXQ module.
>
> The Custom Response paragraph of https://docs.basex.org/wiki/RESTXQ
> indicates :
>
> Custom responses can be generated in XQuery by returning an
> |rest:response| element, an |http:response| child node that matches the
> syntax of the EXPath HTTP Client Module
>  specification, and optional child
> nodes that will be serialized as usual.
>
> So, the §4.1 of http://expath.org/spec/http-client   (EXPath HTTP Client
> Module ) indicates :
>
> message = string>
> (http:header*,
>   (http:multipart |
>http:body)?)
> 
>
>
> But when I try :
>
> declare %rest:path('media4') function page:testjm4() {
> 
> 
>
>
>  TEST
>
>
> };
>
>
> The answer is irremediably :
>
> Stopped at /root/basex/webapp/test.xqm, 46/39:
> [basex:restxq] Unexpected node: http://expath.org/ns/http-client; media-type="text">TEST
> 
>
> Neither hhtp:body or http:multipart element can be placed as a child of
> http:response, that seems contradictory with the expath.org spec...
>
> Any help would be appreciated...
>
> Thanks o lot!
>
> JM
>
> Using :
>
> BaseX Version 10.7
> httpserver : basexhttp
> Operating System: Ubuntu 18.04.6 LTS
> Kernel: Linux 4.15.0-197-generic
> Architecture: x86-64
>
>


[basex-talk] RESTXQ Custom Multipart Response

2023-10-29 Thread Jean-Marc ANSEL

Hello,

I'm trying to do a custom multipart response with basex RESTXQ module.

The Custom Response paragraph of https://docs.basex.org/wiki/RESTXQ  
indicates :


Custom responses can be generated in XQuery by returning an 
|rest:response| element, an |http:response| child node that matches the 
syntax of the EXPath HTTP Client Module 
 specification, and optional child 
nodes that will be serialized as usual.


So, the §4.1 of http://expath.org/spec/http-client   (EXPath HTTP Client 
Module ) indicates :



   (http:header*,
 (http:multipart |
  http:body)?)



But when I try :

declare %rest:path('media4') function page:testjm4() {


      
          
            TEST
          
      
};


The answer is irremediably :

Stopped at /root/basex/webapp/test.xqm, 46/39:
[basex:restxq] Unexpected node: http://expath.org/ns/http-client; 
media-type="text">TEST 

Neither hhtp:body or http:multipart element can be placed as a child of 
http:response, that seems contradictory with the expath.org spec...


Any help would be appreciated...

Thanks o lot!

JM

Using :

BaseX Version 10.7
httpserver : basexhttp
Operating System: Ubuntu 18.04.6 LTS
Kernel: Linux 4.15.0-197-generic
Architecture: x86-64