Hello,<br><br>I'm working with RabbitMQ 2.4.1 for Windows and using the HTTP API to interact with the RabbitMQ server. I notice that, when I try to get messages from a queue, I have to specify the payload encoding - even if the HTTP API Specification (<a href="http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v2_4_1/priv/www-api/help.html">http://hg.rabbitmq.com/rabbitmq-management/raw-file/rabbitmq_v2_4_1/priv/www-api/help.html</a>) doesn't list it in the mandatory keys - and the only accepted value is "base64".<br>
Please, find below the tests I performed:<br><br>1: Specify in the request body all the mandatory fields listed in the HTTP API Specification<br>REQUEST: POST /api/queues/%2f/queue1/get<br>REQUEST BODY: {"count":10,"requeue":false}<br>
Response: HTTP/1.1 400 Bad Request<br> Date: Wed, 04 May 2011 14:47:48 GMT<br> Content-Length: 59<br> Content-Type: text/html<br> Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br>response body: {"error":"bad_request","reason":{"key_missing":"encoding"}}<br>
<br>2. Specify in the request body all the mandatory fields (including "encoding" but using "string" as value)<br>REQUEST: POST /api/queues/%2f/queue1/get<br>
REQUEST BODY: {"count":10,"requeue":false,"encoding":"string"}<br>Response: HTTP/1.1 400 Bad Request<br> Date: Wed, 04 May 2011 15:03:03 GMT<br> Content-Length: 58<br> Content-Type: text/html<br>
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br>response body: {"error":"bad_request","reason":["bad_encoding","string"]}<br><br>3. Specify in the request body all the mandatory fields (including "encoding" but using "base64" as value)<br>
REQUEST: POST /api/queues/%2f/queue1/get<br>
REQUEST BODY: {"count":10,"requeue":false,"encoding":"base64"}<br>Response: HTTP/1.1 200 OK<br> content-type: application/json<br> Date: Wed, 04 May 2011 15:05:14 GMT<br> Content-Length: 2<br>
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)<br> Cache-Control: no-cache<br>response body: []<br><br>Case 1 raises an error because of the lack of a mandatory field (the payload encoding).<br>Case 2 raises an error because of a bad "encoding" value even if when publishing a message into an exchange the values allowed for the "payload_encoding" key are either "string" or "base64".<br>
Case 3 works as expected.<br><br>Is there something wrong in my requests or there is a problem on the server side?<br><br>Regards,<br><br>Salvatore<br>