Skip to content

Commit

Permalink
Merge pull request #13 from FabienO/input-stream
Browse files Browse the repository at this point in the history
change method name for returning the raw POST
  • Loading branch information
Patrick Louys authored Aug 18, 2016
2 parents 6a46052 + 538626f commit ec4f6d8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $request->getCookie($key, $defaultValue = null);
$request->getParameters();
$request->getQueryParameters();
$request->getBodyParameters();
$request->getRawBodyParameters();
$request->getRawBody();
$request->getCookies();
$request->getFiles();
$request->getMethod();
Expand Down
4 changes: 2 additions & 2 deletions src/HttpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ public function getBodyParameters()
}

/**
+ Returns raw values from the read-only stream that allows you to read raw data from the request body.
* Returns raw values from the read-only stream that allows you to read raw data from the request body.
*
* @return string
*/
public function getRawBodyParameters()
public function getRawBody()
{
return $this->inputStream;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function getCookie($key, $defaultValue = null);
public function getParameters();
public function getQueryParameters();
public function getBodyParameters();
public function getRawBodyParameters();
public function getRawBody();
public function getCookies();
public function getFiles();
public function getUri();
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/HttpRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ public function testGetBodyParameter()
$this->assertNull($request->getQueryParameter('key3'));
}

public function testGetRawBodyParameter()
public function testGetRawBody()
{
$post = "{'key1' => 'value1'}";

$request = new HttpRequest([], [], [], [], [], $post);

$this->assertEquals(
$request->getRawBodyParameters(),
$request->getRawBody(),
$post
);
}
Expand Down

0 comments on commit ec4f6d8

Please sign in to comment.