title: Apache HttpClient 4.0. Weird behavior
body: <p>I'm using Apache HttpClient 4.0 for my web crawler. The behavior i found strange is: i'm trying to get page via HTTP GET method and getting response about 404 HTTP error. But if i try to get that page using browser it's done successfully.</p>
  
  <p>Details:
  1. I upload multipart form to server this way:</p>
  
  <pre><code>    HttpPost httpPost = new HttpPost("http://[host here]/in.php");
  
      MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
      entity.addPart("method", new StringBody("post"));
      entity.addPart("key", new StringBody("223fwe0923fjf23"));
      FileBody fileBody = new FileBody(new File("photo.jpg"), "image/jpeg");
      entity.addPart("file", fileBody);
      httpPost.setEntity(entity);
  
      HttpResponse response = httpClient.execute(httpPost);       
      HttpEntity result = response.getEntity();
  
      String responseString = "";
      if (result != null) {
          InputStream inputStream = result.getContent();
  
          byte[] buffer = new byte[1024];
          while(inputStream.read(buffer) &gt; 0)
              responseString += new String(buffer);
  
          result.consumeContent();
      }
  </code></pre>
  
  <p>Uppload succefully ends.</p>
  
  <ol start="2">
  <li><p>I'm getting some results from web server:</p>
  
  <pre><code>    HttpGet httpGet = new HttpGet("http://[host here]/res.php?key="+myKey+"&amp;action=get&amp;id="+id);
  
      HttpResponse response = httpClient.execute(httpGet);
      HttpEntity entity = response.getEntity();
  </code></pre></li>
  </ol>
  
  <p>I'm getting ClientProtocolException while execute method run. I was debugging this situation with log4j. Server answers "404 Not Found". But my browser loads me that page with no problem.</p>
  
  <p>Can anybody help me? </p>
  
  <p>Thank you.</p>