Skip to content
Advertisement

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.

JavaScript

Advertisement

Answer

I was using “com.signalfx.shaded.apache.http.entity.StringEntity” instead of “import org.apache.http.entity.StringEntity” which was causing the issue.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement