# Post Request using uri module to update the parameter flags/values

**URL:** <https://forum.ansible.com/t/post-request-using-uri-module-to-update-the-parameter-flags-values/29781>\
**Category:** Ansible Project\
**Created:** [February 27, 2019, 2:05am UTC](https://forum.ansible.com/t/post-request-using-uri-module-to-update-the-parameter-flags-values/29781 "2019-02-27T02:05:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhijith.devaraju](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@abhijith.devaraju](https://forum.ansible.com/u/abhijith.devaraju)\
**Post date:** [February 27, 2019, 2:05am UTC](https://forum.ansible.com/t/post-request-using-uri-module-to-update-the-parameter-flags-values/29781/1 "2019-02-27T02:05:48Z")

</div>

Hello There,

I have the below GET response for a feature API request. I would like to update the values for the corresponding parameters as follows in the json object:

**“paramValue”: 15**

**“configState”: “ENABLE”**

**GET Response output:**

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [localhost] =\> {  
“msg”: {  
“changed”: false,  
“connection”: “close”,  
“content\_length”: “126”,  
“content\_type”: “application/json”,  
“cookies”: {},  
“date”: “Wed, 27 Feb 2019 01:47:59 GMT”,  
“failed”: false,  
“json”: {  
“configClass”: “MASTER”,  
“configState”: “DISABLE”,  
“id”: “FEATURE-BIT”,  
“instanceId”: 0,  
“paramValue”: 0,  
},  
“msg”: “OK (126 bytes)”,  
“redirected”: false,  
“status”: 200,  
}  
}

I am not sure of the syntax, how to update the values/flags in the json object and send POST request using URI module. Please advice ?

---

<div class="post-metadata">

**Author:** ![abhijith.devaraju](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@abhijith.devaraju](https://forum.ansible.com/u/abhijith.devaraju)\
**Post date:** [February 27, 2019, 2:26am UTC](https://forum.ansible.com/t/post-request-using-uri-module-to-update-the-parameter-flags-values/29781/2 "2019-02-27T02:26:25Z")

</div>

Here is the snipped from the playbook for “GET” request task:

- name: Enable feature bit/parameters  
uri:  
url: https://  
method: GET  
return\_content: yes  
status\_code: 200  
headers:  
Content-Type: application/json  
Cookie: “{{ login.set\_cookie.split(‘;’)[0] }}”  
body\_format: json  
register: api\_result  
tags: enable\_stay\_sec  
changed\_when: false  
failed\_when: api\_result.status != 200

- debug:  
msg: “{{ api\_result }}”
