Full authentication is required to access this resource的两种解决办法
问题:用httpclient做数据上传时报错:Full authentication is required to access this resource
1、用postman测试解决问题,如下图所示添加Bearer Token后添加成功:
token的获取方法:1、通过获取token的接口获取;2、从登录返回的结果中获取
2、使用HttpClient添加header,入图中所示(/code/main/premarital/util/HttpClientUtils.java):
post.addHeader("Authorization", "Bearer " + "BaseJwtToken80023F7F3F92DCF66807EB95AA8E0368BC1965542B72258DEF1F8DA556C3323FF4B097AE45E7E24C48071ED9C655D5DAA1305186C4B3F6EB173704F31ED2CB635F3FF64D94C23ECAD9E621633A6AA887DB4AD91");