如何使用REST和本地javascript访问HP

如何使用REST和本地javascript访问HP

本文介绍了如何使用REST和本地javascript访问HP ALM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想通过REST API通过浏览器(IE11,Firefox)中的本地编写的javascript js访问 ALM ,但无法登录.这是我通过jquery请求LWSSO cookie的代码:

I just want to access ALM via local written javascript js in the browser (IE11, Firefox) via the REST API but I can not login. Here is my code for requesting the LWSSO cookie via jquery:

var auth = btoa(USER+":"+PASSWORD);

$.ajax({
    type: "POST",
    url: https://alm.xxx.net/qcbin/authentication-point/j_spring_security_check,
    headers: {
        "Authorization": "Basic " + auth
    },
    success : function(data) { },
});

响应头包含:

使用OTA/directX对象,一切正常,但我想通过JavaScript使用REST API.谁能帮我吗?

With OTA/directX object everything works fine but I want to use the REST API via javascript. Can anyone help me?

推荐答案

首先;您正在使用哪个版本的ALM?其次,我认为您为认证点使用了错误的URL.根据文档(对于ALM 12.01),它应为 https://alm.xxx.net/qcbin/authentication-point/authenticate .

First of all; which version of ALM are you using? Second, I think you are using the wrong URL for the authentication point. According to the documentation (for ALM 12.01) it should be https://alm.xxx.net/qcbin/authentication-point/authenticate.

此外,您使用的HTTP方法应该是GET,不是 POST.

Also, the HTTP method you use should be GET, not POST.

我注意到您在URL中使用https,所以我假设您的ALM实例已设置为https?

I noticed that you are using https in the URL, so I assume your instance of ALM is set up with that?

这篇关于如何使用REST和本地javascript访问HP ALM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 10:29