[rabbitmq-discuss] Http API: new user
Tobias Gutzmann
Tobias.Gutzmann at ist.com
Mon Aug 26 12:15:32 BST 2013
Hi,
If I'm not totally mistaken, http header names are case-sensitive, so it should be "Content-type", and you might need a space after the colon.
Regards,
Tobias
-----Ursprungligt meddelande-----
Från: rabbitmq-discuss-bounces at lists.rabbitmq.com [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] För SAG - Jonathan Andrés
Skickat: den 26 augusti 2013 13:10
Till: Matthias Radestock
Kopia: Discussions about RabbitMQ
Ämne: Re: [rabbitmq-discuss] Http API: new user
Yes, the message "Error: bad_request, Reason: not_json" is the response of the server. This message:
=ERROR REPORT==== 26-Aug-2013::08:44:04 ===
webmachine error: path="/api/users/newUser"
"Bad Request"
Is in the logs of RabbitMQ.
I'm using CURL/7.31.0 on windows (windows 7 or windows server 2008, the same results).
This others calls works well:
curl -i -u guest:guest http://localhost:15672/api/vhosts
curl -i -v -u guest:guest -H "content-type:application/json" http://localhost:15672/api/users
But I have the same problem with this:
curl -i -u guest:guest -H "content-type:application/json" -XPUT -d'{"type":"direct","auto_delete":false,"durable":true,"arguments":[]}' http://localhost:15672/api/exchanges/%2f/my-new-exchange
The Rabbit admin works well too.
Thank you!
-----Mensaje original-----
De: Matthias Radestock [mailto:matthias at rabbitmq.com] Enviado el: lunes, 26 de agosto de 2013 10:59
Para: SAG - Jonathan Andrés
CC: Discussions about RabbitMQ
Asunto: Re: [rabbitmq-discuss] Http API: new user
On 26/08/13 07:48, SAG - Jonathan Andrés wrote:
> I think I have the last versions of rabbit and Erlang:
>
> =INFO REPORT==== 26-Aug-2013::08:42:28 ===
> Starting RabbitMQ 3.1.5 on Erlang R16B01
>
> If I try with:
>
> curl -i -v -u guest:guest -H "content-type:application/json" -XPUT
> -d'{"password":"secret","tags":"administrator"}'
> http://localhost:15672/api/users/newUser
>
> I get this in the logs:
>
> =ERROR REPORT==== 26-Aug-2013::08:44:04 ===
> webmachine error: path="/api/users/newUser"
> "Bad Request"
>
> And it's the same that works for you. I don't understand what is happening.
I thought you said it complained with "Error: bad_request, Reason:
not_json"?
What version of curl are you running? And on what O/S?
Do other calls to the management API work? Does the management UI work?
Does rabbitmqadmin work?
Regards,
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq-discuss at lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list