PUT in Rest API

Wednesday, 28 June 2017 · 4 messages
CM
Christophe Marchand28 Jun 2017 13:32 #

Hello,

I have a strange behavior, using PUT method on Rest API.

Here is the curl instruction :

curl -i -v -X PUT -H "Content-Type: text/xml" -T /data/pom.xml "http://admin:admin@localhost:1984/rest/valid/pom.xml"

curl displays this :

* Trying 127.0.0.1... * Connected to localhost (127.0.0.1) port 1984 (#0) * Server auth using Basic with user 'admin'

Quoted text · 9 lines
> PUT /rest/valid/ff548ea41-07be-4dae-81c1-a758ed1d3581.xml HTTP/1.1 > Host: localhost:1984 > Authorization: Basic YWRtaW46YWRtaW4= > User-Agent: curl/7.47.0 > Accept: */* > Content-Type: text/xml > Content-Length: 4957 > Expect: 100-continue >

* Done waiting for 100-continue * We are completely uploaded and fine * Connection #0 to host localhost left intact BaseX:33952094826395

And BaseX logs say this :

12:41:23.367 127.0.0.1:43908 admin ERROR Timeout exceeded. 600000.81 ms

There is no other processes open on BaseX, curl is the sole client.

What am I doing wrong ?

Thanks in advance, Christophe

CG
Christian Grün28 Jun 2017 13:41 #

Hi Christophe,

could you please check if the problem occurs with an empty database as well, and provide us with the input data.

Thanks in advance, Christian

Quoted text · Christophe Marchand · 43 lines
On Wed, Jun 28, 2017 at 1:32 PM, Christophe Marchand <cmarchand at oxiane.com> wrote: > Hello, > > > I have a strange behavior, using PUT method on Rest API. > > Here is the curl instruction : > > curl -i -v -X PUT -H "Content-Type: text/xml" -T /data/pom.xml > "http://admin:admin@localhost:1984/rest/valid/pom.xml" > > curl displays this : > > * Trying 127.0.0.1... > * Connected to localhost (127.0.0.1) port 1984 (#0) > * Server auth using Basic with user 'admin' >> PUT /rest/valid/ff548ea41-07be-4dae-81c1-a758ed1d3581.xml HTTP/1.1 >> Host: localhost:1984 >> Authorization: Basic YWRtaW46YWRtaW4= >> User-Agent: curl/7.47.0 >> Accept: */* >> Content-Type: text/xml >> Content-Length: 4957 >> Expect: 100-continue >> > * Done waiting for 100-continue > * We are completely uploaded and fine > * Connection #0 to host localhost left intact > BaseX:33952094826395 > > And BaseX logs say this : > > 12:41:23.367 127.0.0.1:43908 admin ERROR Timeout exceeded. > 600000.81 ms > > There is no other processes open on BaseX, curl is the sole client. > > What am I doing wrong ? > > Thanks in advance, > Christophe >
CG
Christian Grünin reply to Christophe Marchand, 28 Jun 2017, 13:3228 Jun 2017 14:41 #

Hi Christophe,

1984 is the port of the BaseX database server. You will need to use the HTTP port instead [1].

Best, Christian

[1] http://docs.basex.org/wiki/Startup#HTTP_Server

Quoted text · Christophe Marchand · 43 lines
On Wed, Jun 28, 2017 at 1:32 PM, Christophe Marchand <cmarchand at oxiane.com> wrote: > Hello, > > > I have a strange behavior, using PUT method on Rest API. > > Here is the curl instruction : > > curl -i -v -X PUT -H "Content-Type: text/xml" -T /data/pom.xml > "http://admin:admin@localhost:1984/rest/valid/pom.xml" > > curl displays this : > > * Trying 127.0.0.1... > * Connected to localhost (127.0.0.1) port 1984 (#0) > * Server auth using Basic with user 'admin' >> PUT /rest/valid/ff548ea41-07be-4dae-81c1-a758ed1d3581.xml HTTP/1.1 >> Host: localhost:1984 >> Authorization: Basic YWRtaW46YWRtaW4= >> User-Agent: curl/7.47.0 >> Accept: */* >> Content-Type: text/xml >> Content-Length: 4957 >> Expect: 100-continue >> > * Done waiting for 100-continue > * We are completely uploaded and fine > * Connection #0 to host localhost left intact > BaseX:33952094826395 > > And BaseX logs say this : > > 12:41:23.367 127.0.0.1:43908 admin ERROR Timeout exceeded. > 600000.81 ms > > There is no other processes open on BaseX, curl is the sole client. > > What am I doing wrong ? > > Thanks in advance, > Christophe >
CM
Christophe Marchand28 Jun 2017 14:51 #

My mistake.

Thanks a lot.

Best, Christophe

Quoted text · Christian Grün · 56 lines
Le 28/06/2017 à 14:41, Christian Grün a écrit : > Hi Christophe, > > 1984 is the port of the BaseX database server. You will need to use > the HTTP port instead [1]. > > Best, > Christian > > [1] http://docs.basex.org/wiki/Startup#HTTP_Server > > > > On Wed, Jun 28, 2017 at 1:32 PM, Christophe Marchand > <cmarchand at oxiane.com> wrote: >> Hello, >> >> >> I have a strange behavior, using PUT method on Rest API. >> >> Here is the curl instruction : >> >> curl -i -v -X PUT -H "Content-Type: text/xml" -T /data/pom.xml >> "http://admin:admin@localhost:1984/rest/valid/pom.xml" >> >> curl displays this : >> >> * Trying 127.0.0.1... >> * Connected to localhost (127.0.0.1) port 1984 (#0) >> * Server auth using Basic with user 'admin' >>> PUT /rest/valid/ff548ea41-07be-4dae-81c1-a758ed1d3581.xml HTTP/1.1 >>> Host: localhost:1984 >>> Authorization: Basic YWRtaW46YWRtaW4= >>> User-Agent: curl/7.47.0 >>> Accept: */* >>> Content-Type: text/xml >>> Content-Length: 4957 >>> Expect: 100-continue >>> >> * Done waiting for 100-continue >> * We are completely uploaded and fine >> * Connection #0 to host localhost left intact >> BaseX:33952094826395 >> >> And BaseX logs say this : >> >> 12:41:23.367 127.0.0.1:43908 admin ERROR Timeout exceeded. >> 600000.81 ms >> >> There is no other processes open on BaseX, curl is the sole client. >> >> What am I doing wrong ? >> >> Thanks in advance, >> Christophe >>

⚡Generated with XQuery