Search
 
SCRIPT & CODE EXAMPLE
 

PHP

guzzlehttp submit form file

use GuzzleHttpPsr7;

$response = $client->request('POST', 'http://httpbin.org/post', [
    'multipart' => [
        [
            'name'     => 'field_name',
            'contents' => 'abc'
        ],
        [
            'name'     => 'file_name',
            'contents' => Psr7Utils::tryFopen('/path/to/file', 'r')
        ],
        [
            'name'     => 'other_file',
            'contents' => 'hello',
            'filename' => 'filename.txt',
            'headers'  => [
                'X-Foo' => 'this is an extra header to include'
            ]
        ]
    ]
]);
Comment

PREVIOUS NEXT
Code Example
Php :: sort relation model count yii2 
Php :: php simple sse 
Php :: php timezone paris 
Php :: Calculate Math Expression From A String Text With PHP 
Php :: delete all rows in table laravel foreign key 
Php :: debug bar laravel print array 
Php :: composer require rtconner/laravel-tagging 
Php :: php artisan make:widget 
Php :: php $_session err_miss_cache 
Php :: tinker laravel 8 
Php :: html windows logo 
Php :: laravel blade excerpt from body 
Php :: custom blade 
Php :: how to use get php with index php with url 
Php :: laravel get list of files in directory 
Php :: mysql between all months days even null 
Php :: laravel casts pivot table 
Php :: php get day of week number 
Php :: divide page in pdf with page break using php 
Php :: create migration command in laravel 
Php :: laravel get current user id 
Php :: laravel route model binding 
Php :: laravel make model 
Php :: get current content type 
Php :: download image from mysql using php 
Php :: wordpress if page 
Php :: CODEIGNITER codeigniter 4 auth 
Php :: Logging a Massage php 
Php :: test_input php 
Php :: The last ship -inurl:(htm/html/php/pls/txt) intitle:index.of "last modified" (mp4/wma/aac/avi) 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =