Skip to content

Instantly share code, notes, and snippets.

@jdegoes
Created April 23, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdegoes/de4f4d1bfff49d9cf0d9d337ce07dee3 to your computer and use it in GitHub Desktop.
Save jdegoes/de4f4d1bfff49d9cf0d9d337ce07dee3 to your computer and use it in GitHub Desktop.
Adding multipart responses into http4k
// RFC: https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html
interface Response {
fun multipartBoundary(boundary: String): Response
fun multiparts(): List<Response>
//
// The returned Response will use a content type of multipart response with
// a boundary string determined by the implementation.
//
// If you want to use a custom boundary string, then you should first set
// the boundary in the (multipart response) content type of this response.
//
fun multiparts(responses: List<Response>): Response
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment