title: Send a file through a POST request with http_socket in CakePHP?
body: <p>I need to make a HTTP POST call to a Hudson CI server from CakePHP. The call is parametrized and contains a few key/value pairs. Some of those are in fact files which need to be uploaded.</p>
  
  <p>Since I'm using CakePHP, I'd rather use the HttpSocket class which comes with the framework rather then try and write my own cURL based implementation.</p>
  
  <p>So far, the call looks like this:</p>
  
  <p><code>$result = $http->post($apiCall, $params, $auth);</code></p>
  
  <p>$apiCall being the URI of the Hudson REST API.
  $params being an array of parameters which go with the POST call.
  $auth containing a user/pass for Basic Auth which configured with this is instance of Hudson.</p>
  
  <p>I'm a bit puzzled though: what would I need to do to also included files in my $params array?</p>
  
  <p>We are running Hudson v1.371 which should - as far as I've gathered - support file uploads coming from a parametrized build call.</p>
  
  <p>Thanks!</p>