# location header from uri response

**URL:** <https://forum.ansible.com/t/location-header-from-uri-response/22292>\
**Category:** Ansible Project\
**Created:** [August 15, 2016, 2:13pm UTC](https://forum.ansible.com/t/location-header-from-uri-response/22292 "2016-08-15T14:13:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Gardner1](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Adam\_Gardner1](https://forum.ansible.com/u/Adam_Gardner1)\
**Post date:** [August 15, 2016, 2:13pm UTC](https://forum.ansible.com/t/location-header-from-uri-response/22292/1 "2016-08-15T14:13:53Z")

</div>

I’m using the **uri** module to call a REST API. The result of this is shown below. I now want to save the **location** portion into a variable to use later in my script.

How do I do that?

I’ve tried:

register: msg // register: content // register: status

I’m using the **uri** as a pre\_task - if that makes any difference?

I’ve also trying using:

tasks:

- debug: var=msg.location // - debug: var=content.location // - debug: var="{{ status.location}}" // -debug: var="{{ status.location | from\_json }}"

Basically every combination of the obvious.

[![](http://i.stack.imgur.com/UObNv.jpg)](http://i.stack.imgur.com/UObNv.jpg)
