how to upload image in json angular code example

Example 1: can we send image in json in angular

public ResponseEntity<User> handleFileUpload(@RequestPart("user") User user, @RequestPart("file") MultipartFile file)

Example 2: can we send image in json in angular

public ResponseEntity<User> handleFileUpload(@RequestParam("user") User user, @RequestPart("file") MultipartFile file)

Example 3: can we send image in json in angular

curl -i -X POST -H "Content-Type: multipart/form-data" \
-F 'user={"name":"John","age":12};type=application/json' \
-F "[email protected]" http://localhost:8080/post