Am getting 400 Bad Request in Retrofit error after adding parameter to my request method
@GET("/api/add/remark")
void addRemark(@Header("Cookies") HttpCookie cookie, @Query("tenantId") long tenantId, @Query("userId") long userId, @Query("comment") String commentJson, @Query("file") MultipartEntityBuilder multipartEntity, Callback<CreationResponse> callback);
this is how at my server receives it
@RequestMapping("add/remark")
@Secured({"ROLE_ADMIN","ROLE_SITE_USER","ROLE_FIELDUSER"})
@JsonInclude(Include.NON_NULL)
public @ResponseBody
CreationResponse addRemarkController1(@RequestParam String comment,@RequestParam Integer userId,@RequestParam long tenantId,@RequestParam("file") MultipartFile file,HttpServletRequest request) {}
If the multipart parameter is ommitted on both sides am able to send remarks without any fail.
this is how my MultipartEntity adds image
MultipartEntityBuilder entity = MultipartEntityBuilder.create();
entity.addBinaryBody("file", input, ContentType.create("image/jpeg"),photosPath.getName());