web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / HTTP request trigger -...
Power Automate
Unanswered

HTTP request trigger - requiring Content-Type

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

I am building a flow where I would like to require a specific content-type in the http header.

If I build an expression which checks the content-type, it works fine if the header exists, but if it *does not* exist, the flow the fails with "invalid template" because the triggeroutputs()['headers']['content-type'] does not exist.  HTTP 500 is returned with "bad gateway", but I want the flow to fail more gracefully instead (return HTTP 415 - Unsupported media type to the client).


I tried to catch this error by setting a variable to the Content-Type and then different "Run after" actions but the flow does not reach that point, the invalid template error just terminates the flow.

 

Does anyone know a way that I can trap this error and prevent the flow failing?  

 

Thanks!

Categories:
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    The "Run after" would only work after actions, and the "Run after" doesn't work after a trigger.

    I afraid that there is no any way to achieve your requirement in microsoft flow currently.

     

    Best regards,

    Alice

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the reply.

     

    The flow does not fail in the trigger itself, but when I use a condition in the flow to check for the Content-Type header in a condition

    @@triggeroutputs()?['Headers']['Content-Type'] .  If the Content-Type is not specified in the https request, the "Invalid Template" error occurs.  But this seems to fail the entire flow and return an http 500 response rather than execute the "Run After".

     

    Is that the expected behaviour ?

     

    Many thanks for your help!

    Cheers,

    Shane

  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    It is the expected behaviour for "Invalid Template" error if the Content-Type is not specified in the https request.

    Please make sure you have specified the Content-Type in the https request.

     

    Best regards,

    Alice

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard