mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 23:28:33 -04:00
20 lines
332 B
PHP
Executable File
20 lines
332 B
PHP
Executable File
<?php
|
|
|
|
$request = new HttpRequest();
|
|
$request->setUrl('http://mockbin.com/har');
|
|
$request->setMethod(HTTP_METH_POST);
|
|
|
|
$request->setHeaders(array(
|
|
'content-type' => 'text/plain'
|
|
));
|
|
|
|
$request->setBody('Hello World');
|
|
|
|
try {
|
|
$response = $request->send();
|
|
|
|
echo $response->getBody();
|
|
} catch (HttpException $ex) {
|
|
echo $ex;
|
|
}
|