How to use the typed-rest-client/Util.getUrl function in typed-rest-client

To help you get started, we’ve selected a few typed-rest-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / typed-rest-client / test / units / resttests.ts View on Github external
it('resolves a relative path resource with host baseUrl', async() => {
        let res: string = util.getUrl('get/foo', 'http://microsoft.com');
        assert(res === 'http://microsoft.com/get/foo', `should be http://microsoft.com/get/foo but is ${res}`);
    });
github microsoft / typed-rest-client / test / resttests.ts View on Github external
it('resolves a rooted path resource with host baseUrl', async() => {
        let res: string = util.getUrl('/get/foo', 'http://microsoft.com');
        assert(res === 'http://microsoft.com/get/foo', `should be http://microsoft.com/get/foo but is ${res}`);
    });
github microsoft / typed-rest-client / test / resttests.ts View on Github external
it('resolves a empty resource with baseUrl', async() => {
        let res: string = util.getUrl('', 'http://microsoft.com');
        assert(res === 'http://microsoft.com', "should be http://microsoft.com");
    });
github microsoft / typed-rest-client / test / units / resttests.ts View on Github external
it('resolves a rooted path resource with host baseUrl', async() => {
        let res: string = util.getUrl('/get/foo', 'http://microsoft.com');
        assert(res === 'http://microsoft.com/get/foo', `should be http://microsoft.com/get/foo but is ${res}`);
    });
github microsoft / typed-rest-client / test / units / resttests.ts View on Github external
it('resolves a rooted path resource with host baseUrl and passing query parameters', async() => {
        const res: string = util.getUrl('/get/foo', 'http://microsoft.com', _queryParams);
        assert(res === 'http://microsoft.com/get/foo?id=1&foo=bar', `should be http://microsoft.com/get/foo?id=1&foo=bar but is ${res}`)
    });
github microsoft / typed-rest-client / test / units / resttests.ts View on Github external
it('resolves a full resource and no baseUrl', async() => {
        let res: string = util.getUrl('http://microsoft.com/get?x=y&a=b');
        assert(res === 'http://microsoft.com/get?x=y&a=b', `should be http://microsoft.com/get?x=y&a=b but is ${res}`);
    });
github microsoft / typed-rest-client / test / units / resttests.ts View on Github external
it('resolves a null resource with baseUrl and passing query parameters', async() => {
        const res: string = util.getUrl(null, 'http://microsoft.com', _queryParams);
        assert(res === 'http://microsoft.com?id=1&foo=bar', `should be http://microsoft.com?id=1&foo=bar but is ${res}`);
    });
github microsoft / typed-rest-client / test / units / resttests.ts View on Github external
it('resolves a host resource with empty baseUrl and passing query parameters', async() => {
        const res: string = util.getUrl('http://microsoft.com', '', _queryParams);
        assert(res === 'http://microsoft.com?id=1&foo=bar', `should be http://microsoft.com?id=1&foo=bar but is ${res}`);
    });
github microsoft / typed-rest-client / test / resttests.ts View on Github external
it('resolves a rooted path resource with pathed baseUrl', async() => {
        let res: string = util.getUrl('/get/foo', 'http://microsoft.com/bar');
        assert(res === 'http://microsoft.com/get/foo', "should be http://microsoft.com/get/foo");
    });
github microsoft / typed-rest-client / test / resttests.ts View on Github external
it('resolves a just host resource and no baseUrl', async() => {
        let res: string = util.getUrl('http://microsoft.com');
        assert(res === 'http://microsoft.com', "should be http://microsoft.com");
    });