title: Fail Jenkins job getting a non-200 response from curl
body: <p>I have a Jenkins job that executes a curl command to POST to a url.  The curl command looks like this</p>
  
  <pre><code>curl -u user:pass -F file=@filetobeposted.zip -F install=true -v http://myserverurlhere.com:2222/service.jsp
  </code></pre>
  
  <p>The command returns XML with the results like...</p>
  
  <pre><code>    &lt;/log&gt;
    &lt;/data&gt;
    &lt;status code="200"&gt;ok&lt;/status&gt;
  &lt;/response&gt;
  </code></pre>
  
  <p>The Jenkins will be marked as failed if the curl command fails (as it should).  But the jenkins job will NOT be marked as failed if the curl command returns valid XML even though it may return a non-200 code.  </p>
  
  <p>How can I have Jenkins look at the results in the XML to determine pass/fail?</p>