cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Request content type forced to "application/json" despite specifying "consumes" and "produces" in the definition

Here's my endpoint definition - note both consumes and produces have been set to "application/vnd.api+json"

 "/data/v1/projects/{project_id}/storage": {
      "x-summary": "Storage",
      "x-description": "Create storage",
      "post": {        
        "description": "Creates a storage location in the OSS where data can be uploaded to.\n",
        "consumes": [
          "application/vnd.api+json"
        ],
                "produces": [
          "application/vnd.api+json"
        ],
        "parameters": [
                             {
            "$ref": "#/parameters/get_hubs_query"
          },
                   {
            "$ref": "#/parameters/get_hub_projects"
          },
          {
            "$ref": "#/parameters/body_create_storage"
          }
        ],
        "responses": {
          "201": {
            "$ref": "#/responses/storage_created"
          },
          "400": {
            "$ref": "#/responses/bad_input"
          },
          "401": {
            "$ref": "#/responses/unauthorized"
          },
          "403": {
            "$ref": "#/responses/forbidden"
          },
          "404": {
            "$ref": "#/responses/not_found"
          }
        },
        "security": [
          {
            "oauth2_access_code": [
              "data:create"
            ]
          }
        ],
        "x-ads_command_line_example": "curl -X POST -H \"Authorization: Bearer kEnG562yz5bhE9igXf2YTcZ2bu0z\" -H \"Content-Type: application/vnd.api+json\" -d '<Example POST data>' \"https://developer.api.autodesk.com/data/v1/projects/a.45637/storage\"",
        "tags": [
          "Projects"
        ]
      }
    }

 

But the actual request was still forced to "application/json" which resulted in a 415 response from our service:

PShaTnV

Please fix this ASAP!

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Request content type forced to "application/json" despite specifying "consumes" and "produces" in the definition

Hi @bryanhuang233 ,

 

Could you please share a screenshot of the configuration of ypour flow?

 

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.

Highlighted
Helper I
Helper I

Re: Request content type forced to "application/json" despite specifying "consumes" and "produces" in the definition

 @v-alzhan-msft  Are these what you meant by "configuration"? The 415 occurred on the post storage step because our service/endpoint requires "application/vnd.api+json" strictly and Flow would force all requests to "application/json" despite setting the content types correctly in the definition - similiar issues have been reported here but no one ever cared.

IMG_0094.JPGUntitled.png

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (10,827)