alfg/murmur-rest

SetSuperuserPW

Elithrin opened this issue · 5 comments

Hello,

I have a problem with setsuperuserpw

curl -u "user:pass" -X POST -d "truc" http://127.0.0.1:5000/server/1/setsuperuserpw -v --digest -c ./cookie

The server return :

POST /server/1/setsuperuserpw HTTP/1.1
User-Agent: curl/7.35.0
Host: 127.0.0.1:5000
Accept: /
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

  • HTTP 1.0, assume close after body
    < HTTP/1.0 404 NOT FOUND
    < Content-Type: text/html
    < Content-Length: 233
    < Server: Werkzeug/0.11.10 Python/2.7.6
    < Date: Thu, 26 May 2016 10:02:30 GMT
    < <title>404 Not Found</title>

    Not Found

    The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

404 error for this POST request.

Thanks !

Same problem for sendmessage
XX - - [26/May/2016 13:09:26] "POST /servers/ HTTP/1.0" 200 -
XX - - [26/May/2016 13:09:26] "POST /server/2/setsuperuserpw HTTP/1.1" 404 -
XX - - [26/May/2016 13:09:26] "POST /server/2/sendmessage HTTP/1.1" 404 -

alfg commented

Hi @Elithrin,

The formdata password needs to be sent as part of the post payload. So try adding the -F "password=testing" flag to your curl request.

Same goes for /sendmessage: -F "message=testing"

I'll update the docs with these, sorry for that!

Hello,

Thanks for your reply

Unfortunately the solution is not working. I have always 404 error

curl -u "user:pass" -X POST -F "message=testing" http://127.0.0.1:5000/server/6/sendmessage -v --digest -c ./cookie

  • Hostname was NOT found in DNS cache
  • Trying 127.0.0.1...
  • Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0)
  • Server auth using Digest with user 'microheb'

    POST /server/6/sendmessage HTTP/1.1
    User-Agent: curl/7.35.0
    Host: 127.0.0.1:5000
    Accept: /
    Content-Length: 0

  • HTTP 1.0, assume close after body
    < HTTP/1.0 404 NOT FOUND
    < Content-Type: text/html
    < Content-Length: 233
    < Server: Werkzeug/0.11.10 Python/2.7.6
    < Date: Fri, 27 May 2016 08:14:46 GMT
    < <title>404 Not Found</title>

    Not Found

    The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

  • Closing connection 0

Thanks !

alfg commented

Ah, it's a typo in the readme. The resource should be /servers, rather than /server.

Thanks :) it's working