【问题标题】:How can I use the Azure pipelines task library to make an http request?如何使用 Azure 管道任务库发出 http 请求?
【发布时间】:2019-04-02 06:07:48
【问题描述】:

在这里查看图书馆https://github.com/Microsoft/azure-pipelines-task-lib/blob/master/node/docs/azure-pipelines-task-lib.md

我正在使用它来创建一个最小的发布任务,我可以成功调用它。 在这个任务中,我打电话给const myUrl: string = tl.getEndpointUrl('myEndpoint', true); 然后如何使用此 url 发出网络请求?

我尝试了import * as rm from 'typed-rest-client/RestClient'; 并使用了其他客户端,但是当我在 Azure devops 构建代理上运行它时,我得到了输出:

##[错误]未处理:找不到模块'typed-rest-client/RestClient'

【问题讨论】:

    标签: typescript azure-devops azure-devops-extensions


    【解决方案1】:

    我需要确保npm install typed-rest-client --save 与我的.ts 文件所在的文件夹在同一文件夹中运行,以确保它被打包为我上传的node_modules 的一部分。

    【讨论】:

    • 当然,我已经尝试过了,所以表示我需要等待长达 48 小时才能将自己的答案标记为已接受。谢谢提醒。
    猜你喜欢
    • 2016-12-12
    • 2016-11-22
    • 1970-01-01
    • 1970-01-01
    • 2019-10-20
    • 1970-01-01
    • 1970-01-01
    • 2022-07-02
    • 2021-01-26
    相关资源
    最近更新 更多