add a blockquote for every class

This commit is contained in:
Zeke Sikelianos 2016-08-22 14:11:03 -07:00
parent d6a63855c4
commit 3d371e09b7
3 changed files with 23 additions and 13 deletions

View file

@ -50,6 +50,8 @@ Returns the default session object of the app.
## Class: Session
> Get and set properties of a session.
You can create a `Session` object in the `session` module:
```javascript
@ -353,8 +355,10 @@ app.on('ready', function () {
## Class: Cookies
The `Cookies` class gives you ability to query and modify cookies. Instances of
`Cookies` class must be received by using `cookies` property of `Session` class.
> Query and modify a session's cookies.
Instances of the `Cookies` class must be received by using `cookies` property of
`Session` class.
For example:
@ -446,21 +450,22 @@ Removes the cookies matching `url` and `name`, `callback` will called with
## Class: WebRequest
The `WebRequest` class allows to intercept and modify contents of a request at
various stages of its lifetime. Instances of `WebRequest` class must be received
by using `webRequest` property of `Session` class.
> Intercept and modify the contents of a request at various stages of its lifetime.
The methods of `WebRequest` accept an optional `filter` and a `listener`, the
Instances of the `WebRequest` class must be received by using the `webRequest`
property of the `Session` class.
The methods of `WebRequest` accept an optional `filter` and a `listener`. The
`listener` will be called with `listener(details)` when the API's event has
happened, the `details` is an object that describes the request. Passing `null`
happened. The `details` object describes the request. Passing `null`
as `listener` will unsubscribe from the event.
The `filter` is an object that has an `urls` property, which is an Array of URL
The `filter` object has a `urls` property which is an Array of URL
patterns that will be used to filter out the requests that do not match the URL
patterns. If the `filter` is omitted then all requests will be matched.
For certain events the `listener` is passed with a `callback`, which should be
called with an `response` object when `listener` has done its work.
called with a `response` object when `listener` has done its work.
An example of adding `User-Agent` header for requests: