I run ElasticMQ locally to emulate Amazon SQS, and I want to send a JSON file as a MessageBody. Here's an example request that works:
$ curl 'http://localhost:9324/queue/foo?Action=SendMessage&MessageBody={"action":"hey"}'
<SendMessageResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
<SendMessageResult>
[...]
If I want to send a large JSON file, it would make more sense to to that as a POST, something like this:
$ curl 'http://localhost:9324/queue/foo?Action=SendMessage' -X POST \
-H "Content-Type: application/json" --data @./bigdata.json
There was an internal server error.
Is there a way to make this work?
This is an old one now, but I've recently fell short on this and wanted to add in what I've found.
If you set the
Content-Type
totext/plain
the message succeeds, which is so counter intuitive with a json data payload.Reponse