For me it gives...

<http:response xmlns:http="http://expath.org/ns/http-client" status="400" message="Bad Request">
  <http:header name="Server" value="nginx/1.11.5"/>
  <http:header name="Access-Control-Allow-Origin" value="*"/>
  <http:header name="Connection" value="keep-alive"/>
  <http:header name="Content-Length" value="37"/>
  <http:header name="Date" value="Mon, 14 Aug 2017 18:45:48 GMT"/>
  <http:header name="Content-Type" value="text/plain"/>
  <http:body media-type="text/plain"/>
</http:response>
Required argument 'data' is missing.

I think the below should work, but it does not

let $d:="Děti pojedou k babičce. Už se těší"
return http:send-request(<http:request method='POST' href='http://lindat.mff.cuni.cz/services/udpipe/api/process'>
  <http:body media-type ="application/x-www-form-urlencoded">data={encode-for-uri($d)}&amp;tokenizer&amp;tagger&amp;parser</http:body>
</http:request>)

returns:

<http:response xmlns:http="http://expath.org/ns/http-client" status="400" message="Bad Request">
  <http:header name="Server" value="nginx/1.11.5"/>
  <http:header name="Access-Control-Allow-Origin" value="*"/>
  <http:header name="Connection" value="keep-alive"/>
  <http:header name="Content-Length" value="113"/>
  <http:header name="Date" value="Mon, 14 Aug 2017 18:47:32 GMT"/>
  <http:header name="Content-Type" value="text/plain"/>
  <http:body media-type="text/plain"/>
</http:response>
Cannot read input data: The CoNLL-U line 'Děti pojedou k babičce. Už se těší' does not contain 10 columns!

Trying to directly emulate curl

let $target:="http://lindat.mff.cuni.cz/services/udpipe/api/process"

let $data:="Děti pojedou k babičce. Už se těší"

let $req:= <http:request method="POST"  xmlns="http://expath.org/ns/http-client">
  <multipart media-type="multipart/form-data"> 
       <header name="Content-Disposition" value='form-data; name="tokenizer"'/>   
       <body media-type="text/plain"/>
        <header name="Content-Disposition" value='form-data; name="tagger"'/>   
       <body media-type="text/plain"/>
        <header name="Content-Disposition" value='form-data; name="parser"'/>   
       <body media-type="text/plain"/>     
       <header name="Content-Disposition" value='form-data; name="data"'/>
        <header name="Content-Transfer-Encoding"  value='binary'/> 
       <body media-type="text/plain"  />      
</multipart>
</http:request>
return http:send-request($req,$target,("","","",($data)))

This works, except when $data contains non 7bit chars, as here.
In this case base64 data appears in place of the correct text.

It appears to be similar to this issue:

 https://www.mail-archive.com/basex-talk@mailman.uni-konstanz.de/msg09206.html

/Andy



On 14 August 2017 at 19:04, Kendall Shaw <kendall.shaw@workday.com> wrote:

Can you elaborate on “does not work”? What response do you get.

 

From: Giuseppe Celano <celano@informatik.uni-leipzig.de>
Date: Monday, August 14, 2017 at 10:43 AM
To: Kendall Shaw <kendall.shaw@workday.com>
Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: Re: [basex-talk] HTTP module

 

Thanks, Kendall, I tried but it does not work :( 

 

Universität Leipzig
Institute of Computer Science, Digital Humanities
Augustusplatz 10
04109 Leipzig
Deutschland
E-mail: celano@informatik.uni-leipzig.de
E-mail: giuseppegacelano@gmail.com
Web site 1: http://www.dh.uni-leipzig.de/wo/team/
Web site 2: https://sites.google.com/site/giuseppegacelano/

 

On Aug 14, 2017, at 6:53 PM, Kendall Shaw <kendall.shaw@workday.com> wrote:

 

http:send-request(<http:request method='post' 

<http:body media-type ="text/plain">

tokenizer&amp;tagger&amp;parser&amp;data=Děti pojedou k babičce. Už se těší.

</http:body>

</http:request>)