feign icon indicating copy to clipboard operation
feign copied to clipboard

Can't set request header in json format

Open hyfsy opened this issue 2 years ago • 5 comments

image

hyfsy avatar Nov 30 '23 08:11 hyfsy

spring-cloud-starter-openfeign: 3.1.4 feign-core: 11.8

hyfsy avatar Nov 30 '23 08:11 hyfsy

{"a":"b""c"} 这不是一个合法的json格式吧? 试试{"a":"b""c"} 以{开始的header,feign会认为是表达式,会按照 https://datatracker.ietf.org/doc/html/rfc6570#section-3.2.2 的规则处理的

lquterqtd avatar Dec 07 '23 11:12 lquterqtd

Regardless of whether the json format is correct or not, the example I gave above already shows that the header has been parsed as the wrong string, my problem is that the header should support json format, and should not be parsed as a template even if it has {}. In addition, the link you gave is the URI Template specification, not the HTTP Header specification which is showed here: https://datatracker.ietf.org/doc/html/rfc2616#section-4.2

hyfsy avatar Dec 08 '23 05:12 hyfsy

@hyfsy

Please see that -> https://github.com/OpenFeign/feign/issues/1987

It seems the same problem..

raizoor avatar Dec 13 '23 17:12 raizoor

It's the same problem, but it hasn't been solved

hyfsy avatar Dec 14 '23 02:12 hyfsy