Send JSON message to HTTP endpoint of SNS

By the documentation from AWS -
http://docs.aws.amazon.com/sns/latest/dg/SendMessageToHttp.html ,
SNS would send messages to HTTP/HTTPS endpoint in JSON format. But
current implementation of `moto` sends messages in form-data format.
This commit is contained in:
sodastsai 2017-07-30 20:44:06 +08:00
commit 92eedcf291
2 changed files with 11 additions and 2 deletions

View file

@ -84,7 +84,7 @@ class Subscription(BaseModel):
sqs_backends[region].send_message(queue_name, message)
elif self.protocol in ['http', 'https']:
post_data = self.get_post_data(message, message_id)
requests.post(self.endpoint, data=post_data)
requests.post(self.endpoint, json=post_data)
def get_post_data(self, message, message_id):
return {