SpringBoot重新设计对api的调用可在一台PC上运行,但在另一台PC上则返回403禁止

问题描述

标题说明了一切,在一台PC上,我们的Spring Boot调用有效,但是当我们在另一台PC上尝试相同的代码时,该调用返回403禁止,这就是调用

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
CrfLogin crfLogin = new CrfLogin();
crfLogin.setLogin("username");
crfLogin.setPassword("password");
httpentity<CrfLogin> request = new httpentity<>(crfLogin,headers);
try {
    CrfLoginResponse result = restTemplate.postForObject(url,request,CrfLoginResponse.class);
} catch (Exception e) {
    return false;
}

这种行为可能是什么原因?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)