|
@@ 56-64 (lines=9) @@
|
| 53 |
|
return $application->handleRequest($request, new Response()); |
| 54 |
|
} |
| 55 |
|
|
| 56 |
|
public function sendPost(string $uri, array $body, array $headers = []): ResponseInterface |
| 57 |
|
{ |
| 58 |
|
$stream = stream_for(json_encode($body)); |
| 59 |
|
|
| 60 |
|
$request = $this->createRequest('POST', $uri, $headers) |
| 61 |
|
->withBody($stream); |
| 62 |
|
|
| 63 |
|
return $this->send($request); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
public function sendPut(string $uri, array $body, array $headers = []): ResponseInterface |
| 67 |
|
{ |
|
@@ 66-74 (lines=9) @@
|
| 63 |
|
return $this->send($request); |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
public function sendPut(string $uri, array $body, array $headers = []): ResponseInterface |
| 67 |
|
{ |
| 68 |
|
$stream = stream_for(json_encode($body)); |
| 69 |
|
|
| 70 |
|
$request = $this->createRequest('PUT', $uri, $headers) |
| 71 |
|
->withBody($stream); |
| 72 |
|
|
| 73 |
|
return $this->send($request); |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
public function sendDelete(string $uri, array $headers = []): ResponseInterface |
| 77 |
|
{ |