Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 2.02 KB

File metadata and controls

20 lines (15 loc) · 2.02 KB

swift-openapi-genenerator-multipart-formdata

An example of using POST endpoints with multipart/form-data

The primary purpose of this project is to illustrate how to properly create multipart/form-data POST requests with an api client, as generated from an openapi document using the swift-openapi-generator library. This project isn't necessarily useful inandof itself, but it should serve as a helpful starter to building client libraries that can POST efficiently.

This project is currently configured to use a sample glitch backend:

  • Running project: https://swift-openapi-generator-multipart-formdata.glitch.me
  • Server code: https://glitch.com/edit/#!/swift-openapi-generator-multipart-formdata

To run: swift run MultipartCli --image "path/to/image" --description "File description"

There is an optional additional parameter --endpoint, which allows the setting of an arbitrary endpoint. This is useful for testing against localhost or another backend besides the above sample glitch.com host.

Prior art: