问题描述
我有一个Java REST端点:
@POST
@Path("login")
@ApiOperation(value="Login a user with a username and password and return a jwt")
@ApiResponses({
@ApiResponse(code=200,message="Success"),@ApiResponse(code=404,message="Not Found")
})
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public Response login(@ApiParam(required = true) UserLoginRequest userLogin,@Context HttpServletRequest request) {
LoginResponse loginResponse = new LoginResponse();
try {
我使用Postman在本地主机上对其进行测试。
POST https://localhost:8443/corporateInterface/rest/user/reset/forgot-password
{
"email": "[email protected]","recaptcha": "xxxx"
}
我得到了预期的有效答复。
HTTP Status 200 OK
但是,当我尝试在另一台服务器上对其进行测试时:
POST https://dev.server.co/corporateInterface/rest/user/reset/forgot-password
{
"email": "[email protected]","recaptcha": "xxxx"
}
我收到以下错误:
HTTP Status 401 - Authentication required
代码相同,调用请求相同(不同的URL)。
如何使它在服务器上工作?
更多信息
邮递员留言:
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)