Skip to content

Commit

Permalink
Incluindo Header com Location (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafael-neris committed Aug 21, 2023
1 parent b3e2eff commit 58ddeea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Controller/PersonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function create(PersonRequest $request, ResponseInterface $response): Mes
$this->cache->set($person['nick'], '.');
$this->cache->set($person['id'], json_encode($person));

return $response->json($person)->withStatus(201);
return $response->json($person)->withStatus(201)->withHeader('Location', "/pessoas/{$person['id']}");
}

public function show(RequestInterface $request, ResponseInterface $response, string $id): MessageResponseInterface
Expand Down

0 comments on commit 58ddeea

Please sign in to comment.