On Wednesday, 2 January 2019 18:02:20 CET Hristo Georgiev wrote:
> Hi, good point, I removed the "param=" part and the result is still the 
> same. I added the "param=" part because the WebService is using it. For 
> instance, when I use the same JSON file in the Postmane software, I do not 
> add "param=" to it, instead I specify it as a key. The software has the 
> fields "key" and "value", I put "param=" as a key and the JSON content as a 
> "value".
> How can I do that in Ansible, how to specify the key?

If you set
  body_format: form-urlencoded

and then body to        

  body:
    param: "{{ lookup('file','/tmp/outage.json') }}"

and remove the headers: you will in the body get "parm={......" with proper 
urlencoding.


-- 
Kai Stian Olstad


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2216353.e3bPNpK0It%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to