Should you be putting your data payload from curl in a 'body' tag?

uri: 
        url: https://127.0.0.1:9640/*/_settings 
        method: PUT 
        user: admin 
        password: admin 
        force_basic_auth: no 
        return_content: yes 
        body_format: json 
        validate_certs: no 
        headers: 
          Content-Type: "application/json" 
          Accept: "application/json" 
        body: "{ \"index\": { \"refresh_interval\": \"180s\" } }" 

Hope that helps, 

Jim 

On 2018-11-22 07:53, Bishwajit Samanta wrote:

> Dear Team, 
> 
> I am trying to use uri module in ansible, can anybody help me with that. 
> 
> Actual Command: 
> 
> curl -XPUT --insecure -u admin:admin "https://127.0.0.1:9640/*/_settings"; -H 
> 'Content-Type: application/json' -d '{ "index" : { "refresh_interval" : 
> "180s" } }' 
> 
> Ansible URI Module: 
> ------------------------------ 
> 
> uri: 
> url: https://127.0.0.1:9640/*/_settings 
> method: PUT 
> user: admin 
> password: admin 
> force_basic_auth: no 
> return_content: yes 
> body_format: json 
> validate_certs: no 
> headers: 
> Content-Type: "application/json" 
> Accept: "application/json" 
> index: 
> refresh_interval: 180s 
> 
> register: webpage 
> 
> - debug: var=webpage.content 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to ansible-devel+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to