I'm trying to create a POST request with Tsung
<request>
<http url="api.whatever.com" method="POST" version="1.1" contents=""></http>
</request>
How can I send a JSON document in the contents attribute?
contents='{"name": "alex"}'
is of course invalid...
Is there a way I can send JSON with my POST request?
I was able to do this by replacing "
"
and adding the content type header application/json
So my example would become:
content_type='application/json' contents='{"name": "alex"}