-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[FrameworkBundle] PR #26213 Document redirections with 307/308 HTTP status codes #9298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
routing/redirect_in_config.rst
Outdated
Redirecting POST/PUT calls | ||
-------------------------- | ||
|
||
As default behaviour of both methods mentioned above results in sending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a
routing/redirect_in_config.rst
Outdated
|
||
return $collection; | ||
|
||
Switching ``keepRequestMethod`` switch to ``true`` will result in sending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When keepRequestMethod
is set to true with either permanent
set to false which will lead to a 307
response or 308
with permanent
being true. Theses codes will give information in the HTTP request that the method should be repeated without altering the body.
routing/redirect_in_config.rst
Outdated
use Symfony\Component\Routing\Route; | ||
|
||
$collection = new RouteCollection(); | ||
// ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this
routing/redirect_in_config.rst
Outdated
xsi:schemaLocation="http://symfony.com/schema/routing | ||
http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<!-- ... --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this
routing/redirect_in_config.rst
Outdated
|
||
# config/routes.yaml | ||
|
||
# ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove this
routing/redirect_in_config.rst
Outdated
|
||
As default behaviour of both methods mentioned above results in sending | ||
response with ``301`` or ``302`` HTTP status codes, the following call will | ||
be made with use of HTTP request method. But it some scenarios it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use of HTTP request method
WDYM ?
But it some scenarios
But in some scenarios it's either expected or required that the following call [...]
Thank you @Simperfit - all changes applied |
I did some rewords based on https://symfony.com/blog/new-in-symfony-4-1-307-and-308-redirections and added a full config example.
@ZipoKing thanks for contributing the docs for this nice feature that you also contributed ... and congrats on your first Symfony Docs contribution! |
…7/308 HTTP status codes (ZipoKing, javiereguiluz) This PR was merged into the master branch. Discussion ---------- [FrameworkBundle] PR #26213 Document redirections with 307/308 HTTP status codes This documents changes introduced with pull request symfony/symfony#26213 Commits ------- 9468bf9 Reword and added an example c8ce65d Changes after @Simperfit review b3984d0 [PR #26213 Document redirections with 307/308 HTTP status codes
This documents changes introduced with pull request symfony/symfony#26213