Skip to content

Added example of non standard 'X-Requested-With' HTTP header. #1946

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 2 commits into from
Nov 23, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,19 @@ document::
)

The ``server`` array is the raw values that you'd expect to normally
find in the PHP `$_SERVER`_ superglobal. For example, to set the `Content-Type`
and `Referer` HTTP headers, you'd pass the following::
find in the PHP `$_SERVER`_ superglobal. For example, to set the `Content-Type`,
`Referer` and `X-Requested-With' HTTP headers, you'd pass the following (mind
the `HTTP_` prefix for non standard headers)::

$client->request(
'GET',
'/demo/hello/Fabien',
array(),
array(),
array(
'CONTENT_TYPE' => 'application/json',
'HTTP_REFERER' => '/foo/bar',
'CONTENT_TYPE' => 'application/json',
'HTTP_REFERER' => '/foo/bar',
'HTTP_X-Requested-With' => 'XMLHttpRequest',
)
);

Expand Down