Skip to content

Commit

Permalink
#119 add Request::getBody
Browse files Browse the repository at this point in the history
  • Loading branch information
bfoujols committed Aug 23, 2024
1 parent 891a2b5 commit b7cdcfb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/EduFramework/Core/Controller/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,13 @@ public function setRoute(string $route): Request
$this->route = $route;
return $this;
}

/**
* Permet de récupérer le body de la requête HTTP
* @return string
*/
public function getBody(): false|string
{
return file_get_contents('php://input');

Check warning on line 176 in src/EduFramework/Core/Controller/Request.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/EduFramework/Core/Controller/Request.php#L176

The use of function file_get_contents() is discouraged
}
}

0 comments on commit b7cdcfb

Please sign in to comment.