I have a web-service running at AWS (lets say example.com) . I would like to transfer data to the web-service once per hour. I also have Azure account, and I would like to use Azure's Scheduler to transfer data to my web-service.
I can use my web-service by cUrl like this:
curl -H "Content-Type = application/json" -XPOST http://example.com -F imurl=http://example_image.jpg
The above cUrl statement submits a form by using POST method. I would like to do the same thing what cUrl does in Azure Scheduler but I could not figure out how to fill the body.
Here is what I did in Scheduler:
Fail Detail is: Http Action - Response from host '52.164.126.98': 'InternalServerError' Response Headers: Connection: close Date: Thu, 06 Jul 2017 08:16:17 GMT Server: Apache/2.4.18 (Ubuntu) Body: 500 Internal Server Error
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
when I check /var/log/apache2/error.log it says imurl
is not assigned properly.
Please consider using Logic Apps instead of Scheduler for this scenario.
With Logic Apps, start with a recurrence trigger followed by an HTTP action, to send formdata, format the body of the HTTP request like so:
"body": {
"$content-type": "multipart/form-data",
"$multipart": [
{
"body": "val0",
"headers": {
"Content-Disposition": "form-data; name=\"pkey0\""
}
},
{
"body": "val1",
"headers": {
"Content-Disposition": "form-data; name=\"pkey1\""
}
}
]
}
Alternatively, if you have a Swagger definition of the API you're trying to invoke, simply supply that to the HTTP+Swagger action in Logic Apps and we will populate a composer it for you.