veasin / nx-http
http for nx
Installs: 1
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:framework
Requires
- php: >=8.4
- ext-fileinfo: *
Requires (Dev)
- veasin/nx: *
- veasin/nx-tools: >=0.0.12
README
http for nx
composer require urn2/nx-http
class app extends \nx\app{ use \nx\parts\http\stream; } $app =new app; $response =$app->http->patch($uri) //->options(['method' => 'get', 'timeout' => 0.5]) ->query(['CODE'=>404]) ->setLog(function($str){ echo is_string($str) ?$str : json_encode($str, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), "\n"; }) ->send(); var_dump($response); var_dump($response->headers()); var_dump($response->body());