8000 [WIP] re-read of http-foundation component docs by joelclermont · Pull Request #2435 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[WIP] re-read of http-foundation component docs #2435

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

Merged
merged 12 commits into from
Jun 12, 2013
Merged
Prev Previous commit
Next Next commit
change headers example to use a request header (not a response header)
  • Loading branch information
joelclermont committed Mar 30, 2013
commit 59f8e5b1feabee5006d9f7c2d6894c82e02a4293
2 changes: 1 addition & 1 deletion components/http_foundation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ can be accessed via several public properties:
* ``server``: equivalent of ``$_SERVER``;

* ``headers``: mostly equivalent to a sub-set of ``$_SERVER``
(``$request->headers->get('Content-Type')``).
(``$request->headers->get('user-agent')``).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are correct IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. Content-type could be A9A9 used on a POST or PUT. Might I suggest that user-agent still could be a better choice since all requests are likely to have this. If someone is trying out code samples, they might be confused why content-type is coming up null. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are good, so I'm cool with user agent. But I think we should have it be User-Agent - it's true that case doesn't matter when getting the headers, but User-Agent may be a little more recognizable as a header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will make the change. I'm also planning on picking this back up over the weekend to finish the WIP. Thanks for the feedback.


Each property is a :class:`Symfony\\Component\\HttpFoundation\\ParameterBag`
instance (or a sub-class of), which is a data holder class:
Expand Down
0