I am using below api endpoint to fetch the repository details. While trying using curl it’s working. But same not working using Ansible task.
https://travis.example.com/api/repos/{{ ORG_NAME }}/{{ REPO_NAME }}
Ansible Task:
uri:
url: "https://travis.example.com/api/repos/{{ ORG_NAME }}/{{ REPO_NAME }}"
body_format: json
method: GET
follow_redirects: none
validate_certs: false
headers:
Content-Type: "application/json"
Authorization: "token {{ access_token }}"
status_code: [ 200 ]
register: repo
Error
“msg”: “Status code was 500 and not [200]: HTTP Error 500: Internal Server Error”,
“redirected”: false,
“server”: “cloudflare”,
“status”: 500,
“strict_transport_security”: “max-age=15724800; includeSubDomains”,
“url”: “https://travis.example.com/api/repos//”,
“x_request_id”: “xxxxxxxxfc3e4e3a3021d864815177”