Task FAILED, HTTP 411 error
I executed a workflow, but one task has fail and the return message on output data was: "That’s an error. POST requests require a Content-length header. That’s all we know.". The problem is, my server didn't logging anyone request on this endpoint, I suposed is because the request don't came into the endpoint defined. Please, somebody can help me?
{ "name":"MVP", "description":"Workflow MVP", "version":2, "tasks":[ { "name":"create_bandeira", "taskReferenceName":"rf_create_bandeira", "inputParameters":{ "http_request":{ "uri":"https://demo3366496.mockable.io/test", "method":"POST", "headers":{ "Referrer-Policy":"no-referrer", "Content-Length":"0", "Content-Type":"application/json" } } }, "type":"HTTP", "startDelay":0 } ], "outputParameters":{ "Id":"01254", "RazaoSocial":"${rf_create_bandeira.output..statusCode}" }, "schemaVersion":2 }
Solved!
The body for request with POST method is required. I could no find this on documentation, was a experimental solution.
Tks guys!
@Leggrand - can you share how did you add body in workflow def for the post method?
Hello, @akshat-g! The body is free, you do not need to define a template for it in the workflow. What you submit in the requisition will be your body to work on your workflow.
I made a call of my workflow, like this example:
POST /api/workflow/WorkFlowSample?version2&correlationId=1 HTTP/1.1 Host: *.compute-1.amazonaws.com:8080 Content-Type: application/json Cache-Control: no-cache Postman-Token: 279e859c-f51e-4c13-9b0d-4228d831bc99
Body Request:
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
{ "id": "1001", "type": "Regular" },
{ "id": "1002", "type": "Chocolate" },
{ "id": "1003", "type": "Blueberry" },
{ "id": "1004", "type": "Devil's Food" }
]
},
"topping":
[
{ "id": "5001", "type": "None" },
{ "id": "5002", "type": "Glazed" },
{ "id": "5005", "type": "Sugar" },
{ "id": "5007", "type": "Powdered Sugar" },
{ "id": "5006", "type": "Chocolate with Sprinkles" },
{ "id": "5003", "type": "Chocolate" },
{ "id": "5004", "type": "Maple" }
]
}