Hello,<br><br>I'm working with RabbitMQ 2.4.1 for windows and I'm interacting with the server through the HTTP Interface. I notice that I get a HTTP 400 result if I try to create a binding and in the POST request body I don't indicate the "arguments" key. The Management HTTP API specification states that for that command all keys are optional; anyway the server creates the binding but the HTTP Error message doesn't contain the "Location" header (where the URI of your new binding should be reported).<br>
Please, find below the messages I send to RabbitMQ and the replies I receive.<br><br>1. Request body without "argument" key<br>REQUEST: POST /api/bindings/%2f/e/exchange1/q/queue1<br>
REQUEST BODY: {"routing_key":"txtRoute"}<br>RESPONSE: HTTP/1.1 400 Bad Request<br> Date: Wed, 04 May 2011 13:02:53 GMT<br> Content-Length: 60<br> Content-Type: application/json<br> Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br>
RESPONSE BODY: {"error":"bad_request","reason":{"key_missing":"arguments"}}<br><br>2. Empty request body<br>REQUEST: POST /api/bindings/%2f/e/exchange1/q/queue1<br>
REQUEST BODY: {}<br>
RESPONSE: HTTP/1.1 400 Bad Request<br> Date: Wed, 04 May 2011 13:09:53 GMT<br> Content-Length: 88<br> Content-Type: application/json<br> Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br>RESPONSE BODY: {"error":"bad_request","reason":{"key_missing":"routing_key","key_missing":"arguments"}}<br>
<br><br>3. Request body with all keys<br>REQUEST: POST /api/bindings/%2f/e/exchange1/q/queue1<br>REQUEST BODY: {"arguments":[],"routing_key":"txtRoute"}<br>RESPONSE: HTTP/1.1 201 Created<br> Date: Wed, 04 May 2011 13:00:29 GMT<br>
Content-Length: 0<br> Location: ../../../../%2F/e/txtExchange/q/SubscriberHTTP1/txtRoute<br> Content-Type: application/json<br> Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br><br>Just to recap:<br>
Case1: the binding is created with the given "routing_key" but no location is returned<br>Case2: the binding is created but no location is returned<br>Case3: it works as expected<br><br>All above cases have been tested using a direct and a topic exchange.<br>
<br>Is there something wrong in my HTTP request or the HTTP API Specification should be changed?<br><br>Regards,<br><br>Salvatore<br>