Hi,
I am accessing a RESTful API via the following command:
curl -F data=@example.txt -F tokenizer= -F tagger= -F parser= http://lindat.mff.cuni.cz/services/udpipe/api/process > example2.txt
I am wondering what the best way is to do that in BaseX. The service also has a URL syntax, as shown in the following example:
http://lindat.mff.cuni.cz/services/udpipe/api/process?tokenizer&tagger&a.... http://lindat.mff.cuni.cz/services/udpipe/api/process?tokenizer&tagger&parser&data=D%C4%9Bti%20pojedou%20k%20babi%C4%8Dce.%20U%C5%BE%20se%20t%C4%9B%C5%A1%C3%AD.
I have tried:
http:send-request(<http:request method='get' href='http://lindat.mff.cuni.cz/services/udpipe/api/process?tokenizer&tagger&a...)
and works perfectly; but I was trying to put the body of the request in http:body, but it does not work:
http:send-request(<http:request method='get' href='http://lindat.mff.cuni.cz/services/udpipe/api/process%27%3E <http:body media-type ="string"> tokenizer&tagger&parser&data=Děti pojedou k babičce. Už se těší. </http:body> </http:request>)
I could invoke the curl command in BaseX, but maybe there is a more elegant way to send the content of the file (than adding it to the URL). Thanks.
Ciao, Giuseppe
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/