zendesk/zendesk_api_client_php — pull request #56 by ggrossman (2014-12-05 23:06:07+00:00)
Title: [WIP] Support uploading files directly from a string in memory by setting a `body` parameter

A Zendesk customer would like to use zendesk_api_client_php to upload files directly from a string in memory, rather than having to upload from a file on disk.

Reading through the code for the `Http::send` method in https://github.com/zendesk/zendesk_api_client_php/blob/master/src/Zendesk/API/Http.php, it does not appear that this is possible, or not possible cleanly. We always attempt to `fopen` and `fread` a file.

This PR adds support for a `body` parameter which contains the raw data to upload. When `body` is present, we don't attempt to read any file off disk, and put the contents of `body` into `CURLOPT_POSTFIELDS` without setting any other curl parameters like `CURLOPT_INFILE`.

Admission: I haven't had a php setup in years and haven't been able to run this code yet. @dpawluk could we get some help on setting up phpunit, etc.?

/cc @dpawluk @rtatsumi @maximeprades

### References
- Support ticket: https://support.zendesk.com/agent/tickets/916448

### Risks
- None