This commit is contained in:
Marcel Pociot
2020-05-04 14:55:27 +02:00
parent c0ac679f49
commit f92bfbf3f7
3 changed files with 11 additions and 2 deletions

View File

@@ -66,7 +66,7 @@ class LoggedRequest implements \JsonSerializable
'body' => $this->isBinary($this->rawRequest) ? 'BINARY' : $this->parsedRequest->getContent(),
'query' => $this->parsedRequest->getQuery()->toArray(),
'post' => $this->getPostData(),
'curl' => '', //(new CurlFormatter())->format(parse_request($this->rawRequest)),
'curl' => $this->getRequestAsCurl(),
'additional_data' => $this->additionalData,
],
];
@@ -208,4 +208,13 @@ class LoggedRequest implements \JsonSerializable
{
return $this->startTime->diffInMilliseconds($this->stopTime, false);
}
protected function getRequestAsCurl(): string
{
try {
return (new CurlFormatter())->format(parse_request($this->rawRequest));
} catch (\Exception $e) {
return '';
}
}
}

View File

@@ -20,6 +20,7 @@ class HttpConnection
public function send($data)
{
$this->emit('data', [$data]);
$this->socket->send($data);
}

View File

@@ -26,7 +26,6 @@
"ext-json": "*"
},
"require-dev": {
"bfunky/http-parser": "^2.2",
"cboden/ratchet": "^0.4.2",
"clue/block-react": "^1.3",
"clue/buzz-react": "^2.7",