Skip to content

natmchugh/StreamsHttpPost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreamsHttpPost is a class to allow sending of files and other data over HTTP post method specifically without using the cURL library or any none core PHP extensions.

Instead it makes use of the streams extension and sets the data as a stream context. This allows the sending of post requests without the need for libcurl.

--------To Use--------

$request = new StreamsHttpPost('http://example.com');
$data = array(
'foo' => 'bar',
'baz' => 'bat',
);

$page = $request->post($data);


--------To Send Files--------

$request = new StreamsHttpPost('http://example.com');
$data = array(
'foo' => 'bar',
'baz' => 'bat',
);
$request->addFile('picture' => 'path/to/file');
$page = $request->post($data);

About

re-usable class to allow files and other data to be sent over http post method

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages