Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Lukas Kircher
Hi Andy, - just a quick report, as I wasn't able to solve the problem so far. This working using curl as the client curl -X PUT -T aa.pdf http://localhost:9998/tika If I add '--header Content-Type: application/pdf ' it works fine for me, too. If I don't specify the content-type I get a 415:

Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Florent Georges
On 5 January 2014 00:57, Andy Bunce wrote: Hi, curl -X PUT -T aa.pdf http://localhost:9998/tika [...] I have tried: let $file:=C:\tmp\aa.pdf let $request := http:request method='PUT' http:body media-type=application/octet-stream{ fetch:binary($file) }/http:body

Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Dirk Kirsten
Hello, You can also simple get all the request headers using the -v flag when running curl. Or you could use wireshark, which (at least to me) seems easier than using tcpdump. I'd like to reproduce your problem, but I seem to be too stupid to get the Tika server up and running. When running

Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Florent Georges
On 5 January 2014 16:39, Dirk Kirsten wrote: However, I would suggest to try to look at the request sent by curl, as curl sets some headers automatically and I also experienced similar problems before (i.e. for some servers not setting some obscure headers seems to be fatal...) If it is of

Re: [basex-talk] BaseX for noobs: C++ API ?

2014-01-05 Thread Dirk Kirsten
Hello Jean-Marc, I see your point. Unfortunately, I don't have any experience doing Windows socket programming (nor do I run any Windows OS), so I am of not much help here. But I would guess the C code can be quite easily replaced (e.g. OpenSSL is most likely just used for the md5 computation)

Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Andy Bunce
Hi Dirk, The Tika documentation is not very clear[1]. tika-app has a simple server mode. tika-server, which I am using, is a different jar [2] [1] http://stackoverflow.com/questions/12231630/how-to-use-tika-in-server-mode [2] http://mvnrepository.com/artifact/org.apache.tika/tika-server/1.4 On

Re: [basex-talk] BaseX for noobs: C++ API ?

2014-01-05 Thread jean-marc Mercier
Dirk, Thx. Well, I am suffering a lot to develop this C++ BaseX API. I did not succeed in installing the openssl MD5 algorithm, but I finally found a MD5 algorithm that seems to work (at least, it seems to compute the MD5 hash for admin correctly). However, after two days, I still can't connect

Re: [basex-talk] Trying to use http:request to emulate curl -X PUT -T xxx.pdf

2014-01-05 Thread Lukas Kircher
Hi all, again: curl -v -X PUT -T some.pdf http://localhost:9998/tika --header Content-Type: application/pdf ... and tika returns plain text as it should - so a working MIME type would be 'application/pdf'. *Now off to BaseX:* let $request := http:request method='PUT' http:body