title: CURL response different than response to request sent from browser
body: <p>Attempting to submit a form with CURL, both via PHP and the command line.  The response from the server consists of null content (the headers posted below).</p>
  
  <p>When the same URL is submitted via a browser, the response consists of a proper webapge.</p>
  
  <p>Have tried submitting the CURL request parameters via POST and GET via each of the following command line curl flags "-d" "-F" and "-G".</p>
  
  <p>If the query string parameters are posted with "-d" flag, resulting header is:</p>
  
  <p>HTTP/1.1 302 Moved Temporarily<br>
  Date: Thu, 02 Jun 2011 21:41:54 GMT<br>
  Server: Apache<br>
  Set-Cookie: JSESSIONID=DC5F435A96A353289F58593D54B89570; Path=/XXXXXXX<br>
  P3P: CP="CAO PSA OUR"<br>
  Location: <a href="http://www.XXXXXXXX.com/" rel="nofollow">http://www.XXXXXXXX.com/</a><br>
  Content-Length: 0<br>
  Connection: close<br>
  Content-Type: text/html;charset=UTF-8<br>
  Set-Cookie: XXXXXXXXXXXXXXXX=1318103232.20480.0000; path=/<br></p>
  
  <hr>
  
  <p>If the query string parameters are posted with "-F" flag, the resulting header is:</p>
  
  <p>HTTP/1.1 100 Continue<br>
  <br>
  HTTP/1.1 500 Internal Server Error<br>
  Date: Thu, 02 Jun 2011 21:52:54 GMT<br>
  Server: Apache<br>
  Content-Length: 1677<br>
  Connection: close<br>
  Content-Type: text/html;charset=utf-8<br>
  Set-Cookie: XXXXXXXXXXXXXX=1318103232.20480.0000; path=/<br>
  Vary: Accept-Encoding<br>
  <br></p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Apache Tomcat/5.5.26 - Error report&lt;/title&gt;&lt;style&gt;&lt;!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--&gt;&lt;/style&gt; &lt;/head&gt;&lt;body&gt;&lt;h1&gt;HTTP Status 500 - &lt;/h1&gt;&lt;HR size="1" noshade="noshade"&gt;&lt;p&gt;&lt;b&gt;type&lt;/b&gt; Exception report&lt;/p&gt;&lt;p&gt;&lt;b&gt;message&lt;/b&gt; &lt;u&gt;&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;description&lt;/b&gt; &lt;u&gt;The server encountered an internal error () that prevented it from fulfilling this request.&lt;/u&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;exception&lt;/b&gt; &lt;pre&gt;javax.servlet.ServletException: Servlet execution threw an exception&lt;br&gt;
  &lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;root cause&lt;/b&gt; &lt;pre&gt;java.lang.NoClassDefFoundError: com/oreilly/servlet/multipart/MultipartParser&lt;br&gt;
      com.corsis.tuesday.servlet.mp.MPRequest.&lt;init&gt;(MPRequest.java:27)&lt;br&gt;
      com.corsis.tuesday.servlet.mp.MPRequest.&lt;init&gt;(MPRequest.java:21)&lt;br&gt;
      com.corsis.tuesday.servlet.TuesdayServlet.doPost(TuesdayServlet.java:494)&lt;br&gt;
      javax.servlet.http.HttpServlet.service(HttpServlet.java:710)&lt;br&gt;
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)&lt;br&gt;
  &lt;/pre&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;note&lt;/b&gt; &lt;u&gt;The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.&lt;/u&gt;&lt;/p&gt;&lt;HR size="1" noshade="noshade"&gt;&lt;h3&gt;Apache Tomcat/5.5.26&lt;/h3&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Questions:</p>
  
  <ol>
  <li><p>What might cause a server to respond different depending on the nature of the CURL request.</p></li>
  <li><p>How to successfully submit request via CURL?</p></li>
  </ol>