Java code example https://mydata-dev.azure-api.net/RequestDocs

StringEntity reqEntity = new StringEntity("{body}"); request.setEntity(reqEntity); > The method setEntity(StringEntity) is undefined for the type HttpGet

Comments

  •  
    Hi, do you have to set a "body" for a GET method?
    Posted by Hidden Thu, 30 Jul 2020 14:17:06 GMT
  •  
    The issue solved with new class creation (HttpGetWithEntity) and using the new class instead of HttpGet import java.net.URI; import org.apache.http.client.methods.HttpPost; public class HttpGetWithEntity extends HttpPost { public final static String METHOD_NAME = "GET"; public HttpGetWithEntity(URI url) { super(url); } public HttpGetWithEntity(String url) { super(url); } @Override public String getMethod() { return METHOD_NAME; }
    Posted by Hidden Fri, 31 Jul 2020 07:25:57 GMT


You're not signed in. Please sign-in to report an issue or post a comment.