title: Error using HTTP Post
body: <p>I got an error using <code>HttpPost</code> for sending an MMS in Android.</p>
  
  <p>In the Logcat it says:</p>
  
  <blockquote>
    <p>ERROR/Here(447): ---------Error-----Target host must not be null, or set in parameters.</p>
  </blockquote>
  
  <p>My sample code:</p>
  
  <pre><code>String url = "myurl";
  HttpClient httpClient = new DefaultHttpClient();
  
  try {
      httpClient.getParams().setParameter(url, new Integer(90000)); // 90 second
      HttpPost post = new HttpPost(url);
      File SDCard = Environment.getExternalStorageDirectory();
      File file = new File(SDCard, "1.png");
      FileEntity entity;
      entity = new FileEntity(file,"binary/octet-stream");
      entity.setChunked(true);
      post.setEntity(entity);
      post.addHeader("Header", "UniqueName");
      Log.i("MMSHTTP","----post---------------"+post);
  
      HttpResponse response = httpClient.execute(post);
  
      if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
          Log.e("Here",
                "--------Error--------Response Status line code:" + response.getStatusLine());
      }
      else 
      {
          // Here every thing is fine.
      }
  
      HttpEntity resEntity = response.getEntity();
      if (resEntity == null) {
          Log.e("Here","---------Error No Response!!-----");
      }
  } catch (Exception ex) {
      Log.e("Here","---------Error-----"+ex.getMessage());
      ex.printStackTrace();
  } finally {
      httpClient.getConnectionManager().shutdown();
  }
  </code></pre>
  
  <p>How do I fix the error?</p>