Created
November 30, 2012 19:56
-
-
Save sidchilling/4178150 to your computer and use it in GitHub Desktop.
POST with file upload using Requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # Include Requests.php and autoload the internal classes | |
| $data = array( | |
| 'owner' => 'siddharth saha', | |
| 'test_file' => '@' . $file_path # File name to be pre-pended with @ | |
| ); | |
| $response = Requests::request($url, array(), $data, Requests::POST); | |
| if ($response->success) { | |
| $response = json_decode($response->body); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment