Logic App - "Missing header 'Content-Type'"

Alon Keilin 141 Reputation points
2023-01-02T11:53:50.72+00:00

Hi Team,

I'm attempting to get an exported file via HTTP request from Tenable using the logic app.
This is process tree:
275423-process-tree.jpg

275444-http.jpg

275386-http-bad-request.jpg

As you can see there is a bad request:

Status code 400

{
"reasons": [
{
"code": "MISSING_HEADER",
"reason": "Missing header 'Content-Type'"
}
]
}

I'm not sure why it says there is a missing Content-Type.

When i try it on the Tenable website to examine the request, everything works perfectly.
275435-tenable-documentation.jpg

Thank you for your assistance.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
1,824 questions
No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 49,721 Reputation points Microsoft Employee
    2023-01-04T05:44:55.37+00:00

    @Alon Keilin Thanks for reaching out. When you use GET method and pass Content-Type header then this header will be Omitted at the logic app and the header will not be passed to your calling HTTP endpoint. Only in case of POST and PUT operation you can use Content-Type header as documented here.

    Unfortunately, you cannot use Content-Type header with GET operation for the HTTP connector. The workaround would be calling azure function from logic app to offload this functionality.

    No comments

1 additional answer

Sort by: Most helpful
  1. ToffenDask 1 Reputation point
    2023-01-02T12:45:22.597+00:00

    YMMV, but we have had success adding an empty JSON body to the HTTP request:

    275388-jsonbody.png