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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector: Head...
Power Automate
Answered

Custom Connector: Header "content-type" not sent to service

(0) ShareShare
ReportReport
Posted on by 61

I would like to connect to an RestAPI-Service, which needs the header information:

"content-type": "application/x-www-form-urlencoded"
but have problems using it as well in Flow as in PowerApps Smiley Sad
Error code/status is 415:    Unsupported Media Type     Content type '' not supported
 
To reproduce the problem, I tested it with the Postman Echo Server and two header keys: "content-type" and "MyContentType":
In Postman both Key/Value are echoed:
 
Postman.jpg

 

I generate a custom connector with these two header parameters

 

CustomConnector.jpg

and the default response 200:

Response200.jpg

 

The custom connector test shows no error and no problem: both keys are in the response:

CustomConnectorTest.jpg

 

Problem:

If I use it in a Flow "content-type" is missing, only "MyContentType" is accessable:

FlowTest.jpg

 

I've testet the runtime server input: both parameters are transfered to the azure platform

{
 "method":"post",
 "headers":{
 "Content-Type":"application/x-www-form-urlencoded",
 "MyContentType":"application/x-www-form-urlencoded"
 },
 "path":"/post",
 "host":
 {
 "api":
 {
 "runtimeUrl":"https://europe-002.azure-apim.net/apim/flowposttest-5f7e5f68ae5b1cf2d2-5f79e327c051ec9794"
 },
 "connection":
 {"name":"/providers/Microsoft.PowerApps/apis/shared_flowposttest-5f7e5f68ae5b1cf2d2-5f79e327c051ec9794/connections/e38ffb06-9eb2-451d-a51a-5509-8628e957"
 }
 },
 "authentication":
 {
 "scheme":"Key",
 "parameter":"*sanitized*",
 "type":"Raw"
 }
}

Why is the Azure Server deleting the "content-type" parameter?

Categories:
I have the same question (0)
  • v-alzhan-msft Profile Picture
    on at

    Hi @Frank37 ,

     

    Have you created the "content-type" for the output of the custom connector?

    Could you please take a try to add a Compose action under custom connector, and check if you could add am expression or a dynamic content for the "content-type"?

     

    Best regards,

    Alice       

     

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

  • Frank37 Profile Picture
    61 on at

    Hi Alice,

     

    yes, "content-type" is defined for the output of the custom connector, but only to show, that the azure platform is deleting the HTTP-header-parameter  "content-type"

     

    IT's not possible to add a Compose Action, which changes the HTTP-header of the custom connector action. You can only change the url parameters.

     

    Here is a sample Swagger-File for a custom connector (OpenAPI)

     

    If using the custom connector test funktion, the "content-type" header-parameter is sent to the server (and echoed in the reply).

    If using this connector in flow (or PowerApps), the azure platform deletes the  "content-type" header-parameter (why?) and in the echo reply the parameter is missing

     

    {
     "swagger": "2.0",
     "info": {
     "description": "Postman Echo Server",
     "version": "0.1",
     "title": "MyTest2"
     },
     "host": "postman-echo.com",
     "basePath": "/",
     "schemes": [
     "https"
     ],
     "consumes": [],
     "produces": [],
     "paths": {
     "/post": {
     "post": {
     "consumes": [
     "application/x-www-form-urlencoded"
     ],
     "produces": [
     "application/json"
     ],
     "parameters": [
     {
     "name": "Content-Type",
     "in": "header",
     "required": true,
     "type": "string",
     "default": "application/x-www-form-urlencoded",
     "x-ms-visibility": "internal"
     },
     {
     "name": "MyContentType",
     "in": "header",
     "required": true,
     "type": "string",
     "default": "application/x-www-form-urlencoded",
     "x-ms-visibility": "internal"
     }
     ],
     "responses": {
     "200": {
     "description": "default",
     "schema": {
     "type": "object",
     "properties": {
     "url": {
     "type": "string",
     "description": "url"
     },
     "headers": {
     "type": "string",
     "description": "MyContentType"
     },
     "Content-Type": {
     "type": "string",
     "description": "Content-Type"
     }
     }
     }
     }
     },
     "summary": "Echo Server Test",
     "description": "Echo Server Test",
     "operationId": "EchoServerTest"
     }
     }
     },
     "parameters": {},
     "responses": {},
     "securityDefinitions": {},
     "security": [],
     "tags": []
    }
  • Verified answer
    Frank37 Profile Picture
    61 on at

    Here is the solution from GonzaloR (worked for me 👍)

     

    https://powerusers.microsoft.com/t5/General-Power-Automate/Custom-connector-action-with-x-www-form-u...

     

    1. Click "New Policy"
    2. Name your policy
    3. Select "Set HTTP header"
    4. Select the Operations (Actions) that require this header
    5. Header name: "content-type"
    6. Header Value: "application/x-www-form-urlencoded"
    7. Action if header exists: "override"
    8. Run policy on: "Request"

     

  • derb Profile Picture
    30 on at

    Thank you sooo much!  You solved my problem with my custom connector that I could not figure out! Virtual hugs and joy! I have been trying to modify the URL by changing the sample input for about an hour without success... This worked like a charm!

  • jackp514 Profile Picture
    47 on at

    To any one still struggling with this issue, none of these solutions fixed the error for me. The only thing that worked was putting SOMETHING in the "body"

     

    If you put "{ }" in the body it seems to work now.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 307 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 269 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 115 Super User 2026 Season 1

Last 30 days Overall leaderboard