on 05-11-2015 8:26 AM
输入地址http://sever:6405/biprws/raylight/v1/documents/258099/parameters?lovInfo=false,提示No session found in HTTP hader X-SAP-LogonToken,提示找不到会话,这个会话怎么在这个URL里进行添加。
您好,您可能没充分理解restful的用法,它不是说简单的在URL里添加在浏览器打开使用的,它是需要您在您应用程序进行调用的,像您提到的X-SAP-LogonToken,也是需要通过程序的方法添加到http header里的,实现方法视不同的语言是不同的,以java为例,大概的sample code是这样的:
HttpClient httpClient = new DefaultHttpClient();
String url="http://sever:6405/biprws/raylight/v1/documents/258099/parameters?lovInfo=false";
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader("X-SAP-LogonToken","\""+token+"\"");
HttpResponse httpResponse = httpClient.execute(httpGet);
这里的HttpClient的类,是来自org.apache.http的包。
当然您在执行这个之前,是需要事先登陆取得token,这样才能填给X-SAP-LogonToken
取token的话需要用到post方法和这个restful的url
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.