mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
20 lines
502 B
TypeScript
20 lines
502 B
TypeScript
|
|
|
|
import traverson = require('traverson');
|
|
|
|
function testTraverson()
|
|
{
|
|
var mediaTypeHandler: any = {};
|
|
|
|
traverson.registerMediaType('application/some-fancy+json', mediaTypeHandler);
|
|
|
|
traverson.from('http://example.api.com/')
|
|
.follow('link_to')
|
|
.withTemplateParameters({'id': 1})
|
|
.get(function(error, document, traversal) {
|
|
traversal.continue().follow('link_back').get(function(error, document, traversal) {
|
|
///
|
|
});
|
|
});
|
|
}
|