# why does ansible code with put method is failing

**URL:** <https://forum.ansible.com/t/why-does-ansible-code-with-put-method-is-failing/32832>\
**Category:** Ansible Developer\
**Created:** [May 2, 2020, 2:55am UTC](https://forum.ansible.com/t/why-does-ansible-code-with-put-method-is-failing/32832 "2020-05-02T02:55:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_M1](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@Raj\_M1](https://forum.ansible.com/u/Raj_M1)\
**Post date:** [May 2, 2020, 2:55am UTC](https://forum.ansible.com/t/why-does-ansible-code-with-put-method-is-failing/32832/1 "2020-05-02T02:55:36Z")

</div>

Hi list,

I am using this ansible code using http method PUT, I have tried changing body to body: ‘{ “NewPassword” : “{{ Password }}” }’ but none of that is helping. I am getting error: “msg”: “Status code was 400 and not [204]: HTTP Error 400: Bad Request”  
Please suggest, here is the ansible code:
