Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
$request = Yii::$app->request->getRawBody();
- $raw = Yii::$app->request->getRawBody();
- $hdrs = Yii::$app->request->headers;
-
- Yii::warning([
- 'method' => Yii::$app->request->method,
- 'contentType' => (string)$hdrs->get('content-type'),
- 'contentLength' => (string)$hdrs->get('content-length'),
- 'encoding' => (string)$hdrs->get('content-encoding'),
- 'rawLen' => strlen($raw),
- 'sha1' => sha1($raw),
- ], 'upload.debug');
+
try {
$result = Json::decode($request);
} catch (Exception $ex) {