Forum Discussion

jberger's avatar
jberger
New Member
3 years ago

Does Swagger Editor supports Multiparts Custom Headers ?

Hi all !

I'm using swagger Editor v3.16.3.
I tried the sample of code from https://swagger.io/docs/specification/describing-request-body/multipart-requests/ in order to add custom headers to my file parts.

The custom header is not displayed in the try-out area of swagger ui, and is not sent at all.

 

Could you tell me if it is due to the swagger editor I'm using ?

 

Also the final goal was to send the Content-Length Header for each part of the form. Do you have any better advice to achieve this ?

 

Thanks in advance,

 

Regards,

 

Ju'

1 Reply

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi jberger,

     

    Custom headers defined in the "encoding" attribute are not supported in "try it out" yet. You can follow this issue for status updates:

    https://github.com/swagger-api/swagger-ui/issues/5356

     

    As for Content-Length, RFC 7578 says:

    >>

    The multipart/form-data media type does not support any MIME header fields in parts other than Content-Type, Content-Disposition, and (in limited circumstances) Content-Transfer-Encoding. Other header fields MUST NOT be included and MUST be ignored.

    <<

    so this is not supported.