Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Simulate POST _FILE #116

Closed
dashawk opened this issue May 7, 2014 · 2 comments
Closed

Cannot Simulate POST _FILE #116

dashawk opened this issue May 7, 2014 · 2 comments

Comments

@dashawk
Copy link

dashawk commented May 7, 2014

Can't seem to process Input file types.

Here is my snippet:

    $this->load->helper('Requests');
    Requests::register_autoloader();

    $url = 'http://www.myurl.com/api/pictures';
    $data = array('fileUpload' => $_FILES);
    $request = Requests::post($url, array(), $data);

This snippet cannot get the $_FILES.

@ghost
Copy link

ghost commented May 7, 2014

$this->load->helper('Requests');
Requests::register_autoloader();

var_dump($_FILES); // ?

$url = 'http://www.myurl.com/api/pictures';
$data = array('fileUpload' => $_FILES);
/* maybe @see http://bit.ly/1hwPXIY
*/
$request = Requests::post($url, array(), $data);

@rmccue
Copy link
Collaborator

rmccue commented May 7, 2014

Can't seem to process Input file types.

Requests is not used for incoming data like $_FILES, but rather for sending requests. You'll need to handle $_FILES yourself, then pass the data to Requests.

See #34 for adding support for sending files (which is not the same as working with $_FILES).

@rmccue rmccue closed this as completed May 7, 2014
@dashawk
Copy link
Author

dashawk commented Oct 8, 2014

Thanks guys, I will look into your suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants