Skip to content
Advertisement

Tag: http-post

HTTP POST with request body

For this request, I am trying to set the entity, however when I do request.setEntity, it says required type HttpEntity, on upcasting it to HttpEntity as request.setEntity((HttpEntity) entity) it still gives me exception. Answer I was using “com.signalfx.shaded.apache.http.entity.StringEntity” instead of “import org.apache.http.entity.StringEntity” which was causing the issue.

Posting image to wcf rest service from Android

I’m having a problem to post a image to my wcf rest service. I’m posting some parameters of which one of them is a base64 utf-8 encoded string (the image). My problem is that every time I post I get “bad request”. Here is the code It is something with the encoded string, but what? Answer I don’t see why

Advertisement