2
votes

I have made a workflow using Http Listener and Http actions in Azure Logic Apps. Listener is to catch POST request and Http action has details of my api which is hosted over azure web app. Request is multipart/form-data type and posts a file along with 3 other string values.

My problems are

  1. If I'm explicitly setting content type header as multipart/form-data in Http action, it is not passing any boundary to api controller and my api is giving error "request was rejected because no multipart boundary was found".
  2. If I'm trying to pass @triggers().outputs.body.ContentType as header of my http action, I'm getting this error:

{"code":"InvalidTemplate","message":"Unable to process template language expressions in action 'http' inputs at line '1' and column '11': 'Error converting value \"multipart/form-data; boundary=----WebKitFormBoundaryi3knGy6dh92BdKdr\" to type 'Microsoft.WindowsAzure.ResourceStack.Common.Collections.InsensitiveDictionary`1[System.String]'. Path 'headers'.'."}

Please help, how can I pass content type and boundary both to my api using Http action?

1

1 Answers

0
votes

The headers object in the Logic app definition is a JSON object with keys and values. Specifically, if you want to pass the content-type header like above your object definition in the code view would look like:

"MyAction" : {
  "type" : "http",
  "inputs" : {
    "headers" : {
      "Content-type" : "@triggerBody().ContentType"
    },
    "body" : … rest of properties here …

Hopefully this is why your API isn't getting the boundary either.