title: The type List is not generic; it cannot be parameterized with arguments [HTTPClient]
body: <pre><code>import java.awt.List;
  import java.awt.image.BufferedImage;
  import java.io.BufferedReader;
  import java.io.ByteArrayOutputStream;
  import java.io.File;
  import java.io.InputStreamReader;
  import java.util.ArrayList;
  
  import javax.imageio.ImageIO;
  
  import org.apache.commons.codec.binary.Base64;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.entity.UrlEncodedFormEntity;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.impl.client.DefaultHttpClient;
  import org.apache.http.message.BasicNameValuePair;
  import org.omg.DynamicAny.NameValuePair;
  
  public class Upload {
  
      public static void main (String[] args) {
  
          System.out.println(Imgur("C:\\Users\\username\\Desktop\\image.jpg",     "clientID"));
      }
  
  public static String Imgur (String imageDir, String clientID) {
      //create needed strings
      String address = "https://api.imgur.com/3/image";
  
      //Create HTTPClient and post
      HttpClient client = new DefaultHttpClient();
      HttpPost post = new HttpPost(address);
  
      //create base64 image
      BufferedImage image = null;
      File file = new File(imageDir);
  
      try {
          //read image
          image = ImageIO.read(file);
          ByteArrayOutputStream byteArray = new ByteArrayOutputStream();
          ImageIO.write(image, "png", byteArray);
          byte[] byteImage = byteArray.toByteArray();
          String dataImage = new Base64().encodeAsString(byteImage);
  
          //add header
          post.addHeader("Authorization", "Client-ID" + clientID);
          //add image
          List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(1);
          nameValuePairs.add(new BasicNameValuePair("image", dataImage));
          post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
  
          //execute
          HttpResponse response = client.execute(post);
  
          //read response
          BufferedReader rd = new BufferedReader(new         InputStreamReader(response.getEntity().getContent()));
          String all = null;
  
          //loop through response
          while (rd.readLine() != null) {
              all = all + " : " + rd.readLine(); 
          }
  
          return all;
  
      }
      catch (Exception e){
          return "error: " + e.toString();
      }
  }
  }
  </code></pre>
  
  <p>So I have that code and I got it from <a href="https://stackoverflow.com/questions/14710247/uploading-to-imgur-v3-using-java-https-errors">uploading to Imgur v3 using Java https errors</a> and I get an error on line 50 for "List" telling me</p>
  
  <blockquote>
    <p>The type List is not generic; it cannot be parameterized with arguments </p>
  </blockquote>
  
  <p>What can I do to solve this?</p>
  
  <p>I'm using <a href="http://hc.apache.org/httpclient-3.x/" rel="noreferrer">http://hc.apache.org/httpclient-3.x/</a> and want to upload an image to imgur using their v3 API.</p>
  
  <p>EDIT: After changing the import I now get these errors.</p>
  
  <p>That solves that but give me two more errors. </p>
  
  <pre><code>nameValuePairs.add(new BasicNameValuePair("image", dataImage));
  </code></pre>
  
  <blockquote>
    <p>The method add(NameValuePair) in the type List is not applicable for the arguments (BasicNameValuePair)</p>
  </blockquote>
  
  <p>And</p>
  
  <p><code>post.setEntity(new UrlEncodedFormEntity(nameValuePairs));</code> </p>
  
  <blockquote>
    <p>The constructor UrlEncodedFormEntity(List) is undefined </p>
  </blockquote>