mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 23:28:33 -04:00
20 lines
446 B
PHP
Executable File
20 lines
446 B
PHP
Executable File
<?php
|
|
|
|
$request = new HttpRequest();
|
|
$request->setUrl('http://mockbin.com/har');
|
|
$request->setMethod(HTTP_METH_POST);
|
|
|
|
$request->setHeaders(array(
|
|
'content-type' => 'application/json'
|
|
));
|
|
|
|
$request->setBody('{"number":1,"string":"f\\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}],"boolean":false}');
|
|
|
|
try {
|
|
$response = $request->send();
|
|
|
|
echo $response->getBody();
|
|
} catch (HttpException $ex) {
|
|
echo $ex;
|
|
}
|