cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bryanhuang233
Level: Powered On

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
Community Support Team
Community Support Team

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.

bryanhuang233
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 309 members 4,545 guests
Please welcome our newest community members: