title: RabbitMQ - Get messages from a queue using curl
body: <p>I am trying to get a few messages from a queue using the HTTP API of rabbitmq.</p>
  
  <p>I am following the documentation in <a href="https://rawcdn.githack.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_9/priv/www/api/index.html" rel="noreferrer">here</a>
  I have no <code>vhost</code> configured.</p>
  
  <p>I tried the following curl command:</p>
  
  <pre><code>curl -i -u guest:guest -H "content-type:application/json" -X POST http://127.0.0.1:15672/api/queues/foo/get -d'{"count":5,"requeue":true,"encoding":"auto","truncate":50000}'
  </code></pre>
  
  <p>RabbitMQ then answers:</p>
  
  <pre><code>HTTP/1.1 405 Method Not Allowed
  vary: origin
  Server: MochiWeb/1.1 WebMachine/1.10.0 (never breaks eye contact)
  Date: Thu, 20 Apr 2017 08:03:28 GMT
  Content-Length: 66
  Allow: HEAD, GET, PUT, DELETE, OPTIONS
  
  {"error":"Method Not Allowed","reason":"\"Method Not Allowed\"\n"}
  </code></pre>
  
  <p>Can you point out my mistake? How can I get these messages?</p>