Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

guzzle Request with POST files

$response = $client->request('POST', 'http://www.example.com/files/post', [
    'multipart' => [
        [
            'name'     => 'file_name',
            'contents' => fopen('/path/to/file', 'r')
        ],
        [
            'name'     => 'csv_header',
            'contents' => 'First Name, Last Name, Username',
            'filename' => 'csv_header.csv'
        ]
    ]
]);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #guzzle #Request #POST #files
ADD COMMENT
Topic
Name
6+8 =