Search code examples
springcurlpostmanmultipart

how to send multipart data and json data together in one request using curl or postman


I have a case where I have to save json data and upload a file in one request.

this is how I am doing in spring

      public void profile (@RequestBody @Validated @Valid ProfileDTO profileDTO,
         @RequestPart("file") @Valid MultipartFile file){
/// saving to db    
}

Now how can I test this using curl and postman?


Solution

  • after: https://github.com/postmanlabs/postman-app-support/issues/1104

    You can not do this in Postman yet (postman devs works on this feature).

    Other users send json data as a file, but it is only a work around available in Postman.