You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to create route to receive upload file to server but not able to find a way to implement it. I have seen multipart content provider in code but not sure how to use it.
Hi, It is natively supported by the library, example Request type definition:
@FormDataRequest
data classPDFFileCreateDTO(@PartEncoding("application/pdf") valfile:NamedFileInputStream, valname:String, valpublic:Boolean)
// then in your route like usual
post<Params, Response, PDFFileCreateDTO> { params, payload ->...
}
It has not been tested yet on the experimental branch, but it should work, if it doesn't please create an issue.
I am trying to create route to receive upload file to server but not able to find a way to implement it. I have seen multipart content provider in code but not sure how to use it.
How to write post data server code for multipart something like this:
https://ktor.io/servers/uploads.html
The text was updated successfully, but these errors were encountered: