首页 > 解决方案 > 如何在 TypeScript HTTP 请求中使用 DefaultCredentials

问题描述

需要帮助在 Typescript 中找到类似的这种 powershell 构造:

Invoke-WebRequest -Uri "http://internalurl"  -Method Get -UseDefaultCredentials

我在打字稿中尝试了以下请求:

        const options = {
            url: `${this.endpoint}/API/${url}`,
            withCredentials: true
        };

        const response = await request(options);
        return JSON.parse(response);

不确定如何指定使用默认凭据的请求。

标签: node.jstypescript

解决方案


推荐阅读