Skip to content

Commit

Permalink
[docs] Document username/password for Y.io config. Fix yui#1572
Browse files Browse the repository at this point in the history
  • Loading branch information
customcommander committed Jan 24, 2014
1 parent 6900949 commit 3b429e9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/io/docs/index.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ YUI().use("io-base", function(Y) {
<td>headers (object)</td>
<td>Specific HTTP headers and values to be sent with the transaction (e.g., <code>{ 'Content-Type': 'application/xml; charset=utf-8' } </code>).</td>
</tr>
<tr>
<td>username (string)</td>
<td>Username for a basic HTTP authentication (e.g. .htaccess)</td>
</tr>
<tr>
<td>password (string)</td>
<td>Password for a basic HTTP authentication (e.g. .htaccess)</td>
</tr>
<tr>
<td>on (object)</td>
<td>This object can be used to register transaction event handlers for the set of supported io events, listed below. These events fire in addition to the global io events. All events handlers are optional.
Expand Down Expand Up @@ -250,6 +258,23 @@ var cfg = {

```

<p>Example of authentication with `Y.io`.</p>

```
Y.io('priv/data.json', {
username: 'foo',
password: 'bar',
on: {
success: function () {
//got the data, carry on
},
failure: function () {
//err, 401
}
}
});
```

<h3>The Response Object</h3>
<p>
When a transaction, using the XHR object as a transport, is complete, the response data are passed as an object to the event handler.
Expand Down

0 comments on commit 3b429e9

Please sign in to comment.