Open kokoichi206 opened 2 years ago
@Multipart @POST("/api/post/create") suspend fun createPost( @Part postData: MultipartBody.Part, @Part postImage: MultipartBody.Part ): BasicApiResponse<Unit>
val response = api.createPost( postData = MultipartBody.Part .createFormData( "post_data", gson.toJson(request) ), postImage = MultipartBody.Part .createFormData( name = "post_image", filename = imageFile.name, body = imageFile.asRequestBody() ) )
multipart request (using image file)
interface
Impl