Send a file through a POST request with http_socket in CakePHP?

brettwfloyd

New Member
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.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.So far, the call looks like this:\[code\]$result = $http->post($apiCall, $params, $auth);\[/code\]$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.I'm a bit puzzled though: what would I need to do to also included files in my $params array?We are running Hudson v1.371 which should - as far as I've gathered - support file uploads coming from a parametrized build call.Thanks!
 
Back
Top