Android Retrofit Base64 @Body
Hola, todo lo que tengo es este código en Android 4.3 y estoy usando la actualización en este momento, pero el servidor me envió un mensaje de error "La entrada no es una cadena Base-64 válida, ya que contiene un carácter no base 64, más de dos caracteres de relleno, o un carácter ilegal entre los caracteres de relleno ". Cuando estoy usando retrofit
//Normal HttpClient
//Base64 String
photo = new String(b);
// Creating HTTP client
HttpClient httpClient = new DefaultHttpClient();
// Creating HTTP Post
HttpPut httpPut = new HttpPut("http://beta2.irealtor.api.iproperty.com.my.ipga.local/PhotoService/"
+ mPropertyId + "/testWatermark"
);
httpPut.setHeader("content-type", "application/x-www-form-urlencoded");
httpPut.setHeader("Authorization","WFdSeW8vTJ1Z3oQlBJMk53VGpaekZRY2pCd1pYSlVXU090");
httpPut.setHeader("Accept", "application/json");
httpPut.setEntity(new StringEntity(photo, "utf-8"));
HttpResponse response = httpClient.execute(httpPut);
//With retrofit
@Headers({
"content-type:application/x-www-form-urlencoded"
})
@PUT("/PhotoService/{PROPERTYID}/{WATERMARK}") String uploadPhoto(
@Body String photo,
@Path("PROPERTYID") String propertyId,
@Path("WATERMARK") String watermark);