[rabbitmq-discuss] Http API: new user

SAG - Jonathan Andrés jandres at omie.es
Mon Aug 26 07:48:41 BST 2013


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.




-----Mensaje original-----
De: Matthias Radestock [mailto:matthias at rabbitmq.com] 
Enviado el: viernes, 23 de agosto de 2013 18:33
Para: Discussions about RabbitMQ
CC: SAG - Jonathan Andrés
Asunto: Re: [rabbitmq-discuss] Http API: new user

On 22/08/13 17:51, SAG - Jonathan Andrés wrote:
> Yes, you are right, sorry, I did it in a hurry.
>
> But If i try with this:
>
> curl -i -v -u guest:guest -H "content-type:application/json" -XPUT 
> -d'{"password":"secret","tags":"administrator"}' 
> http://localhost:15672/api/users/newUser
>
>
> Now i get this:
>
> Error: bad_request, Reason: not_json.

The above works fine for me against 3.1.5 on Erlang R16B:

$ curl -i -v -u guest:guest -H "content-type:application/json" -XPUT -d'{"password":"secret","tags":"administrator"}' 
http://localhost:15672/api/users/newUser
* About to connect() to localhost port 15672 (#0)
*   Trying 127.0.0.1... connected
* Server auth using Basic with user 'guest'
 > PUT /api/users/newUser HTTP/1.1
 > Authorization: Basic Z3Vlc3Q6Z3Vlc3Q=  > User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0
OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3  > Host: localhost:15672  > Accept: */*  > content-type:application/json  > Content-Length: 44  >
* upload completely sent off: 44out of 44 bytes < HTTP/1.1 204 No Content
HTTP/1.1 204 No Content
< Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact) < Date: Fri, 23 Aug 2013 16:28:43 GMT
Date: Fri, 23 Aug 2013 16:28:43 GMT
< Content-Type: application/json
Content-Type: application/json
< Content-Length: 0
Content-Length: 0

<
* Connection #0 to host localhost left intact
* Closing connection #0


Perhaps you are running a rabbit/erlang that is too old.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list