The corresponding HTTP request will look as follows: POST /uploadĬontent-Disposition: form-data name="fileName" filename="file1.txt"Ĭontent-Disposition: form-data name="fileName" filename="file2.png"Ĭontent-Disposition: form-data name="fileName" filename="file3.jpg"įor more information about file upload in OpenAPI, see the following sections of the OpenAPI 3. MIME types are case-insensitive but are traditionally written in lowercase. Use the multipart media type to define uploading an arbitrary number of files (an array of files): requestBody: The parameter values can be case-sensitive. ![]() The corresponding HTTP request payload will include multiple parts: POST /uploadĬontent-Type: multipart/form-data boundary=abcde12345Ĭontent-Disposition: form-data name="orderId"Ĭontent-Disposition: form-data name="userId"Ĭontent-Disposition: form-data name="fileName" filename="attachment.txt" To describe a file sent with other data, use the multipart media type. This definition corresponds to an HTTP request that looks as follows: POST /upload Files use a type: string schema with format: binary or format: base64, depending on how the file contents will be encoded. Under content, specify the request media type (such as image/png or application/octet-stream). ![]() Use the requestBody keyword to describe the request payload containing a file. In OpenAPI 3.0, you can describe files uploaded directly with the request content and files uploaded with multipart requests. If you use OpenAPI 2.0, see our OpenAPI 2.0 guide.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |