【问题标题】:How to call Other Application API from Script in Service-Now如何从 Servicenow 中的脚本调用另一个应用程序 API
【发布时间】:2019-02-07 17:17:30
【问题描述】:

我在 Python 中使用 Django 编写了一些 API,我现在想从服务中调用这个 API 从脚本

我尝试使用 jQuery 调用我的 API,但这对我来说并不适用,我在网上搜索他们说在 service- 中使用 $j 作为 jQuery-现在,但它也不起作用。

我想测试我的 API,它是否工作正常。

如果我遗漏了任何步骤或任何人知道我是如何实现的,请告诉我或更正我。

【问题讨论】:

    标签: servicenow servicenow-rest-api


    【解决方案1】:

    您应该使用原版 javascript。如果您是从客户端拨打电话,这应该可以:

    var xhr = new XMLHttpRequest();
    xhr.onreadystatechange = function() {
        if (xhr.readyState == XMLHttpRequest.DONE) {
            alert(xhr.responseText);
        }
    }
    xhr.open('GET', 'http://example.com', true);
    xhr.send(null);
    

    看看这个帖子:How to get the response of XMLHttpRequest?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多