Forum Discussion

younseb's avatar
younseb
New Contributor
6 years ago

swagger multipart TypeError: Failed to fetch

Hello,

I have a swagger installed on IIS Windows Server 2016. 

It is linked with ServiceNow. I have several paths and methods working fine except this single one.

It is using a multipart request body.

 

I get an error "TypeError: Failed to fetch"

I have tried the code on the swaggerHub and it worked;

I suspect something is missing on my IIS or on my swagger UI config. Do you have any clue?

 

post:
parameters:
- name: "Content-Type"
in: "header"
required: true
schema :
type : "string"
default: "multipart/form-data"
requestBody:
content:
multipart/form-data:
schema:
type: "object"
properties:
table_name:
type: 'string'
format: 'string'
example : "rm_feature"
table_sys_id:
type: 'string'
format: 'string'
example : "6e1ef1f41bd9bf4421d44111cd4bcb2f"
data:
type: "string"
format: "binary"

 

    • younseb's avatar
      younseb
      New Contributor

      Hello Tanya.

      It is actually the opposite...

      1. This code is working fine on swaggerHub

      2. This isn't working on my server on SwaggerUI and SwaggerEditor.

       

      Another thing, I have several paths & methods. All are working (GET, POST, PUT, DELETE with json).

      Only this one with content-Type multipar/form-data doesn't work on my server.

       

      I suspect it may has to do with some permissions (no file upload allowed).

      If so I'm not sure which folder should be opened on SwaggerUI.

      • RonRatovsky's avatar
        RonRatovsky
        Staff

        Which version of Swagger UI do you use? At what point do you gett the error? Is that the full error you're seeing? Can you check the browser console for any additional details around that error?