0

enter image description here

I'm trying to integrate my application to RabbitMQ. I want to send a request to my localhost, so what should be the HTTP header and its value?

Do I need a username and password to access localhost via a HTTP request?

SmokeDetector
  • 751
  • 2
  • 8
  • 12
Nerdal
  • 3
  • 2
  • 8

1 Answers1

0

yes you have to add username and password:

Suppose to have username and pwd as test test it will be:

  1. Create queue: curl -X PUT -H "Content-Type: application/json" -d '{"auto_delete":false,"durable":true,"arguments":[]}' -u test:test http://localhost:15672/api/queues/%2f/my_queue
  2. publish a message to a queue: curl -s -X POST -H "Content-Type: application/json" -d '{"properties":{"delivery_mode":2}, "routing_key":"my_queue","payload":"message test ","payload_encoding":"string"}' -u test:test http://localhost:15672/api/exchanges/%2f/amq.default/publish

  3. get the queues: curl -X GET -u test:test http://localhost:15672/api/queues/%2F

Here all the API

you need to add authorization as : http header

Community
  • 1
  • 1
Gabriele Santomaggio
  • 21,656
  • 4
  • 52
  • 52