Skip to content

Commit

Permalink
Merge pull request yiisoft#6137 from cdvrooman/patch-8
Browse files Browse the repository at this point in the history
Update runtime-requests.md
  • Loading branch information
qiangxue committed Nov 20, 2014
2 parents d3c3d68 + 1c462f2 commit 5a52503
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/guide/runtime-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $name = $request->post('name', '');
```

> Info: Instead of directly accessing `$_GET` and `$_POST` to retrieve the request parameters, it is recommended
that you get them via the `request` component like shown above. This will make writing tests easier because
that you get them via the `request` component as shown above. This will make writing tests easier because
you can create a mock request component with faked request data.

When implementing [RESTful APIs](rest-quick-start.md), you often need to retrieve parameters that are submitted
Expand Down Expand Up @@ -108,13 +108,13 @@ $accept = $headers->get('Accept');
if ($headers->has('User-Agent')) { // there is User-Agent header }
```

The `request` component also provides support for quickly accessing some commonly used headers, including
The `request` component also provides support for quickly accessing some commonly used headers, including:

* [[yii\web\Request::userAgent|userAgent]]: returns the value of the `User-Agent` header.
* [[yii\web\Request::contentType|contentType]]: returns the value of the `Content-Type` header which indicates
the MIME type of the data in the request body.
* [[yii\web\Request::acceptableContentTypes|acceptableContentTypes]]: returns the content MIME types acceptable by users.
The returned types ordered by the quality score. Types with the highest scores will be returned first.
The returned types are ordered by their quality score. Types with the highest scores will be returned first.
* [[yii\web\Request::acceptableLanguages|acceptableLanguages]]: returns the languages acceptable by users.
The returned languages are ordered by their preference level. The first element represents the most preferred language.

Expand Down

0 comments on commit 5a52503

Please sign in to comment.