mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 23:28:33 -04:00
21 lines
527 B
PHP
Executable File
21 lines
527 B
PHP
Executable File
<?php
|
|
|
|
$client = new http\Client;
|
|
$request = new http\Client\Request;
|
|
|
|
$body = new http\Message\Body;
|
|
$body->append('{"number":1,"string":"f\\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}],"boolean":false}');
|
|
|
|
$request->setRequestUrl('http://mockbin.com/har');
|
|
$request->setRequestMethod('POST');
|
|
$request->setBody($body);
|
|
|
|
$request->setHeaders(array(
|
|
'content-type' => 'application/json'
|
|
));
|
|
|
|
$client->enqueue($request)->send();
|
|
$response = $client->getResponse();
|
|
|
|
echo $response->getBody();
|