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.

How do I print the content of httprequest request?

I’ve got a bug involving httprequest, which happens sometimes, so I’d like to log HttpGet and HttpPost request’s content when that happens. So, let’s say, I create HttpGet like this: This is the string representation that I’d like to get: With the post request, I’d also like to get the content string. What is the easiest way to do it

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