Skip to content
This repository has been archived by the owner on Aug 10, 2018. It is now read-only.

Commit

Permalink
docs(readme): added browsers within readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Templier committed Jun 16, 2015
1 parent f9e31b2 commit dc68b87
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,36 @@ Restlet JS also provides a client support to call REST resources:
(...)
});

### Within browsers

Restlet JS also provides a client support to call REST resources with browsers:

<html>
<head>
<script type="text/javascript" src="jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="lodash.min.js"></script>
<script type="text/javascript" src="moment-2.10.3.js"></script>
<script type="text/javascript" src="restlet.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#test').click(function() {
restlet.createClientResource('http://localhost:8080/data.json').get({
accept: 'application/json',
parameters: [ 'entity' ],
convertInputEntity: true
}, function(entity) {
console.log('>> entity = ' + JSON.stringify(entity));
});
});
});
</script>
</head>

<body>
<span id="test">Run Restlet client</span>
</body>
</html>

## Documentation

| Version | Status | Documentation |
Expand Down

0 comments on commit dc68b87

Please sign in to comment.