Hello all,
I would like to know what the status of multipart HTTP request currently
is.
I read from the docs that it's experimental but to me it feels like
there's currently a regression (is there any working example?).
I have some requests that were working correctly up to 7.6.1 AFAIR.
From 7.8 on (including latest) I always get this error message when
posting multipart requests:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"/>
<title>Error 400 Stopped at .../restxq.xqm, 106/10:
[experr:HC0004] Invalid request element: No body specified for
http:part.</title>
</head>
<body>
<h2>HTTP ERROR 400</h2>
<p>Problem accessing /multipart. Reason:
<pre> Stopped at
/home/lettere/Desktop/basex80/webapp/restxq.xqm, 106/10:
[experr:HC0004] Invalid request element: No body specified for
http:part.</pre>
</p>
<hr />
<i>
<small>Powered by Jetty://</small>
</i>
<br/>
[...]
<br/>
</body>
</html>
This is the entry point:
declare %restxq:path("multipart/")
%restxq:POST("{$message}")
%restxq:consumes("multipart/form-data")
%output:method('xml')
function page:hello2($message) {
<response>
<title>Hello!</title>
content <info>It seems you posted a message: { $message }</info>
</response>
};
and finally this is the HTTP request:
POST /multipart HTTP/1.1
Host: localhost:9000
Connection: keep-alive
Content-Length: 162
Cache-Control: no-cache
Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/35.0.1916.153 Safari/537.36
Content-Type: multipart/form-data; boundary='bounds'
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,it;q=0.6
--bounds
Content-Disposition: content
Content-Type: application/xml
<a/>
--bounds
Content-Disposition: metadata
Content-Type: application/xml
<b/>
--bounds
Thanks a lot,
Marco.