Add this and try:
headers:
      Content-Type: "application/json"

On Friday, September 28, 2018 at 1:20:42 PM UTC-5, Shyam wrote:
>
> Hi,
>
> Unable process the JSON request in POST method can any one help.
>
> *---*
> *- hosts: windows*
>
> *  remote_user: [email protected] <javascript:>*
>
> *  tasks:*
>  
> *  - name: POST a body to an endpoint*
>
> *    win_uri:*
>
> *      url: http://server_url_for_api/file.exe 
> <http://server_url_for_api/file.exe> *
>       
> *      method: post*
>      
> *      user: [email protected] <javascript:>*
>
> *      password: xxxxxxxxxxxxxxxxxxxxx*
>
> *      force_basic_auth: yes*
>
> *      body:  "{{ lookup('file','test.json') }}"*
>
> *      body_format: json*
>
> *      content_type: "application/json"*
>
> *      return_content: yes*
>
>
>  
>       
> *      Getting the following error: *
>
> *                  fatal: [server_hostname]: FAILED! => {"base_response":  
> { "CharcterSet": "ISO-8859-1", "ContentEncoding": *
> *                 "Status_description" : "No Content",*
> *                   "Method": "POST"*
> *                     "msg": "status  code of request '204' is not in list 
> of valid status codes 204"*
>
> *Can any one help ?*
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c99a0cf3-a089-4454-bd37-5057faf1e2f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to