Hi,
I want to call a webhook from Ansible via the URI module, this is the playbook:
---
- hosts: localhost
tasks:
- name: Call webhook
uri:
method: POST
I get the following error:
"content": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"
http://www.w3.org/TR/html4/strict.dtd\">\r\n<HTML><HEAD><TITLE>Length Required</TITLE>\r\n<META HTTP-EQUIV=\"Content-Type\" Content=\"text/html; charset=us-ascii\"></HEAD>\r\n<BODY><h2>Length Required</h2>\r\n<hr><p>HTTP Error 411. The request must be chunked or have a content length.</p>\r\n</BODY></HTML>\r\n"
"msg": "Status code was not [200]: HTTP Error 411: Length Required",
"redirected": false,
"server": "Microsoft-HTTPAPI/2.0",
"status": 411,
When I try to access the webhook via Powershell, it works without a problem.
$response = Invoke-RestMethod -Method Post -Uri $uri
Can somebody point me in the right direction?