我在Salesforce中的Page Reference对象上设置标题和Cookie时遇到问题。以下是我使用的APEX代码:
PageReference page = new PageReference('https://mysystem.com/service');
page.getHeaders().put('Authorization', authorizationHeader);
Cookie cookie = new Cookie('TestName', 'TestValue', '/', -1, false);
List<Cookie> c=new List<Cookie>();
c.add(cookie);
page.setCookies(c);
此代码执行“https://mysystem.com/service”的GET HTTP请求,而不设置任何标头或Cookie。似乎参数消失了。有人知道那里有什么问题吗?
此外,是否可以使用页面引用对象对NON-salesforce域系统进行基本身份验证?