title: Why can't java find StringEntity class even after importing org.apache.http packages?
body: <p>I am using a  sample code from Microsoft Cognitive Services. It makes use of StringEntity class to make request to the REST API. The java compiler seems to be unable to find 'symbol' StringEntity? What could be the reason for this and how to resolve this? 
  Here goes the code - </p>
  
  <pre><code>import java.net.URI;
  import org.apache.http.HttpEntity;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpGet;
  import org.apache.http.client.utils.URIBuilder;
  import org.apache.http.impl.client.HttpClients;
  import org.apache.http.util.EntityUtils;
  import org.apache.http.*;
  
  
  public class NEWS_FETCHER 
  {
      public static void main(String[] args) 
      {
          HttpClient httpclient = HttpClients.createDefault();
  
          try
          {
              URIBuilder builder = new URIBuilder("https://api.cognitive.microsoft.com/bing/v5.0/news/search");
  
              builder.setParameter("q", "microsoft");
              builder.setParameter("count", "10");
              builder.setParameter("offset", "0");
              builder.setParameter("mkt", "en-us");
              builder.setParameter("safeSearch", "Moderate");
  
              URI uri = builder.build();
              HttpGet request = new HttpGet(uri);
              request.setHeader("Ocp-Apim-Subscription-Key", "&lt;Key goes here&gt;");
  
              // Request body
              StringEntity reqEntity = new StringEntity("");
              request.setEntity(reqEntity);
  
              HttpResponse response = httpclient.execute(request);
              HttpEntity entity = response.getEntity();
  
              if (entity != null) 
              {
                  System.out.println(EntityUtils.toString(entity));
              }
          }
          catch (Exception e)
          {
              System.out.println(e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>Most of it is taken from Microsoft API Test Sample.
  <a href="https://dev.cognitive.microsoft.com/docs/services/56b43f72cf5ff8098cef380a/operations/56b449fbcf5ff81038d15cdf" rel="nofollow noreferrer">https://dev.cognitive.microsoft.com/docs/services/56b43f72cf5ff8098cef380a/operations/56b449fbcf5ff81038d15cdf</a></p>