title: Could not find class 'org.apache.http.entity.mime.content.Filebody', referenced from method
body: <p>What I'm trying to do is to send a picture to a web server. When I call a method in my Android project I get the following error: could not find class 'org.apache.http.entity.mime.content.Filebody', referenced from method com.example.tc.Send.send.</p>
  
  <p>This happens eventhough I've got the following imports:</p>
  
  <pre><code>import org.apache.http.HttpEntity;
  import org.apache.http.HttpResponse;
  import org.apache.http.client.HttpClient;
  import org.apache.http.client.methods.HttpPost;
  import org.apache.http.entity.mime.MultipartEntity;
  import org.apache.http.entity.mime.content.FileBody;
  import org.apache.http.impl.client.DefaultHttpClient;
  </code></pre>
  
  <p>This is what the class looks like in which the method lies:</p>
  
  <pre><code>public class Send {
  public Send(){
  }
  
  public static String send(String path) throws Exception {
      String filePath = path;
      String svar;
  
      HttpClient httpclient = new DefaultHttpClient();
      try {
          HttpPost httppost = new HttpPost("path to web server"); 
          FileBody pic = new FileBody(new File(filePath)); 
          MultipartEntity requestEntity = new MultipartEntity(); 
          requestEntity.addPart("file", pic);
  
          httppost.setEntity(requestEntity);
          System.out.println("executing request " + httppost.getRequestLine());
          HttpResponse response = httpclient.execute(httppost);
          HttpEntity responseEntity = response.getEntity();
          System.out.println("----------------------------------------");
          System.out.println(response.getStatusLine());
  
          ByteArrayOutputStream outstream = new ByteArrayOutputStream();
          response.getEntity().writeTo(outstream);
          byte [] responseBody = outstream.toByteArray();
          svar = new String(responseBody);
          System.out.println(svar);
  
      } finally {
          try {
              httpclient.getConnectionManager().shutdown();
          } 
          catch (Exception ignore) {
          }
      }
      return svar;
  }
  }
  </code></pre>
  
  <p>Can anyone see what the problem is?</p>