springcloud中feign访问其他服务并传参数出现错误的问题status 405 reading IndexService#del(Integer); content: {"timestamp

status 405 reading IndexService#del(Integer); content: {"timestamp":"2018-06-02T08:00:49.203+0000","status":405,"error":"Method Not Allowed","message":"Request method 'POST' not supported","path":"/del"}


当使用feign传参数的时候,需要加上@RequestParam注解,否则对方服务无法识别参数;

@FeignClient(value = "client2")
public interface IndexService {

    @RequestMapping(value = "/test2",method = RequestMethod.GET)
    String getclient2(@RequestParam("str") String str);        //此处
}

你可能感兴趣的:(springcloud中feign访问其他服务并传参数出现错误的问题status 405 reading IndexService#del(Integer); content: {"timestamp)