Skip to content

Commit

Permalink
document null response
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Apr 4, 2020
1 parent b96d660 commit 92122c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ $app->run();

## Response handling

Ever wondered why you should encode output or call template renderer in every single route?
Ever wondered why you should encode output or call template renderer in every single route? or even why respond with a ResponseInterface object in the end?

```php
$app->get('/hello/{name}', function ($request, $response, $args) {
Expand All @@ -140,7 +140,7 @@ $app->get('/hello/{name}', function ($request, $response, $args) {
})->setName('profile');
```

Route callbacks normally respond with a `Psr\Message\ResponseInterface` object, but thanks to slim-routing they can now respond with a more intent expressive ResponseType object that will be handled afterwards
Route callbacks normally respond with a `Psr\Message\ResponseInterface` object, but thanks to slim-routing they can now respond with a string, null or event better, with a more intent expressive ResponseType object that will be handled afterwards

Of course normal ResponseInterface responses from route callback will be treated as usual

Expand Down

0 comments on commit 92122c4

Please sign in to comment.