# New URI module from Romeo Theriault

**URL:** <https://forum.ansible.com/t/new-uri-module-from-romeo-theriault/12370>\
**Category:** Ansible Project\
**Created:** [February 16, 2013, 11:50pm UTC](https://forum.ansible.com/t/new-uri-module-from-romeo-theriault/12370 "2013-02-16T23:50:27Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [May 27, 2014, 9:51pm UTC](https://forum.ansible.com/t/new-uri-module-from-romeo-theriault/12370/21 "2014-05-27T21:51:33Z")

</div>

> Sorry to be a bother . . . can anyone say how I should be formatting the data ion my body here:

- name: artifactory | TEST - create repo  
uri: url={{ baseurl }}/api/repositories/ **test**  
method=PUT user=user password=password  
body=‘{“rclass”: “local”}’  
force\_basic\_auth=yes status\_code=200 HEADER\_Content-Type=“application/json”

yaml doesn’t like the colon (🙂 in the body . . . the body is for JSON, right?

Thanks!

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 28, 2014, 11:53am UTC](https://forum.ansible.com/t/new-uri-module-from-romeo-theriault/12370/22 "2014-05-28T11:53:15Z")

</div>

The rule in YAML is if you have a colon in the line, you must quote the whole line. In this case, the uri stuff probably needs quotes around the whole beast.

You might find it easy to store the “body” in a “vars:” to make it a little easier to read.

---

<div class="post-metadata">

**Author:** ![Guy\_Matz1](https://avatars.discourse-cdn.com/v4/letter/g/b5e925/32.png) [@Guy\_Matz1](https://forum.ansible.com/u/Guy_Matz1)\
**Post date:** [May 28, 2014, 3:21pm UTC](https://forum.ansible.com/t/new-uri-module-from-romeo-theriault/12370/23 "2014-05-28T15:21:23Z")

</div>

> darned yaml/json . . . the space in my body was the problem!

I had body=‘{“rclass”: “local”}’ . . . needed to be body=‘{“rclass”:“local”}’

Thanks all!

[Previous page](https://forum.ansible.com/t/new-uri-module-from-romeo-theriault/12370.md?page=1)
