@FeignClient(name = "testclient", url = "${feign.url.httpToTest}", fallback = TestFallback.class)
public interface TestClient {
@RequestMapping(value = "/test/get", method = RequestMethod.POST,consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)Maptest(@RequestParam("source") String source,@RequestParam("type") String type);复制代码
}
TraceFeignClient:89 - The modified request equals POST HTTP/1.1
X-Access-Source: INNER
X-Span-Name: http:/violate_token/v1/get
Accept: application/json;charset=UTF-8
X-B3-SpanId: 48d666cf8c39e387
X-B3-Sampled: 0
X-B3-TraceId: 48d666cf8c39e387
Content-Type: application/x-www-form-urlencoded
说明: Content-Type:是接口提供方的接收方式,通过consumes来配置,默认是Form表单提交(application/x-www-form-urlencoded) Accept: 是接口调用方接收返回结果的方式,通过produces来设置