Skip to content

Commit 640922b

Browse files
author
Niels Theen
committed
Adapt README
1 parent 8d3da05 commit 640922b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ the request to following endpoint.
5959
To add dynamic values in the REST API definition the operator `:` can be used
6060

6161
```php
62-
$server->post('/say/:word', function (\Psr\Http\Message\ServerRequestInterface $request, callable $next, array $arguments) {
63-
$word = $arguments['word'];
62+
$server->post('/say/:word', function (\Psr\Http\Message\ServerRequestInterface $request, callable $next, array $parameters) {
63+
$word = $parameters['word'];
6464

6565
return new \React\Http\Response(200, array(), 'You said: ' . $word);
6666
});
6767
```
6868

6969
Now a HTTP client can call the address e.g. `http://localhost:8080/say/hello`.
70-
The key `word` and value `hello` will be stored in query parameters of the
71-
PSR-7 request.
70+
The key `word` and value `hello` will be stored in the third
71+
parameter of the callback function.
7272

7373
There is no type check her that can validate which API should be used.
7474
`/say/:word` and`/say/:number` would be the same. In this case the order of your API

0 commit comments

Comments
 (0)