If you use try with -vvv then you can see the parameters with which
the module was invoked.

On Mon, 2 Mar 2020 at 12:44, Himanshu Pupneja <[email protected]> wrote:
>
> I am facing issue in URI module, Could you please help me in this
> It works well with postman and curl command.
>
>
>
> Below module is failing
>
> =============================
>   - name: Connect to website
>     uri:
>       url: https://xyz.com/api.php
>       headers:
>         apikey: "xyz1"
>         apitoken: "xyz2
>         cmd: "xyz"
>       body_format: "form-urlencoded"
>       body:
>         abc: "123"
>         def: "456"
>       return_content: yes
>       validate_certs: no
>       method: POST
>       timeout: 60
>       use_proxy: no
> ================================
>
> ===========Error Output============
>
> "msg": "Status code was 401 and not [200]: HTTP Error 401: Unauthorized",
>
> ========================
>
>
> ============Curl - which is working==========
>
> curl --location --request POST 'https://xyz.com/api.php' \
>
> --header 'apikey: xyz' \
>
> --header 'apitoken: xyz' \
>
> --header 'cmd: xyz' \
>
> --data-urlencode 'abc=123' \
>
> --data-urlencode 'def=456'
>
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/1f433a02-4835-4cc7-a05d-197cf302c6cc%40googlegroups.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwNu0iJWNBgT_igHHuec_paupGKO5%2BTDLM5ndhp2oUSv_w%40mail.gmail.com.

Reply via email to