【发布时间】:2020-10-07 22:42:25
【问题描述】:
我正在尝试在我的 Spring-Boot 应用程序中使用 FeignClient 向 https://pixabay.com/api?key=17079440-d2facf535011df5d60e5ccfe2&q=Playstation%203&image_type=photo 发出请求,但已抛出此异常:
2020-06-17 21:10:24.730 ERROR 14008 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException: [301 Moved Permanently] during [GET] to [https://pixabay.com/api?key=17079440-d2facf535011df5d60e5ccfe2&q=Playstation%203&image_type=photo] [PixabayClient#getImageUrl(String,String,String)]
我已经尝试通过邮递员和浏览器发出请求,响应正常返回:(
这是我的 FeignClient 类:https://pastebin.com/MFhFs5um
还有我的 pom.xml:https://pastebin.com/4XXjYkyE
【问题讨论】:
-
会不会是
http -> https重定向引起的问题? -
您的相关代码,例如您的 FeignClient 类,需要在问题中出现,而不仅仅是在 pastebin 中。使用 pastebin 可以补充,但所有需要回答的信息都应该是问题本身的一部分。
标签: java spring-boot spring-cloud-feign openfeign