# Can't send JSON code using uri module

**URL:** <https://forum.ansible.com/t/cant-send-json-code-using-uri-module/19544>\
**Category:** Ansible Project\
**Created:** [October 19, 2015, 5:24am UTC](https://forum.ansible.com/t/cant-send-json-code-using-uri-module/19544 "2015-10-19T05:24:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mick\_st\_john](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Mick\_st\_john](https://forum.ansible.com/u/Mick_st_john)\
**Post date:** [October 19, 2015, 5:24am UTC](https://forum.ansible.com/t/cant-send-json-code-using-uri-module/19544/1 "2015-10-19T05:24:36Z")

</div>

I am trying to send a JSON payload using uri module through body parameter. The variables {{ network-name }} and and {{ IP1 }} are imported from config.yml.

I have defined body in vars. The json code which I am trying to print is getting created properly using (debug: var={{ body | to\_json}}). But, the output which I am redirecting to the dest file is showing errors. What could be the reason that the JSON payload is not getting sent at the destination url.

Here’s the ansible playbook:
