eraoop99
eraoop99

Reputation: 11

Angular / SpringBoot how to send an image file as Request Body?

all the tutorials that i have seen tend to treat an image as a stand alone model and send it using a FormData , what i want is to include the image file as a property of an object Called Course,

what is the process to do so , and in what way should i receive my image in the back-end if it was a property of a model

Upvotes: 0

Views: 219

Answers (1)

Arun Prasat
Arun Prasat

Reputation: 360

You can use it by using an @Multipart annotation and getting the image as MultiPartBody.part. You can check in the below link for more detailed explanation. How to Upload Image file in Retrofit 2

Upvotes: 1

Related Questions