Skip to content

A sample package that uses swift-openapi-generator to upload multipart data.

Notifications You must be signed in to change notification settings

everyplace/swift-openapi-generator-multipart-formdata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

A sample package that uses swift-openapi-generator to upload multipart data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages