-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest supporting POJO as request parameter #1253
Comments
In feign's DefaultContract, a parameter without any annotations is assumed to be processed by feign's Encoder, which can do what's been requested here. We can decide if this behavior makes sense or not. |
Thanks for @adriancole 's reply. In current Spring Cloud Netflix Feign's implementation it seems feign doesn't encode POJO to HTTP request parameter by default, or there's something I do not know yet |
@wanghongfei are you saying that you want something to literally write each field as a query parameter (ex via reflection)? If so, that would be a custom encoder and I don't think it is a high-reuse thing at this point. |
closest thing in feign upstream is |
@adriancole Thanks, I'll try |
@wanghongfei 请问这个问题你最后怎么解决的? |
@adriancole @wanghongfei My PR #1361 allows |
@wongloong
tips: |
Right, this issue is for a GET method, not post. |
yml:
MAVEN:
SendPoint(get method):
ReceivePoint(post method):
|
I use RequestInterceptor to solve this problem:
|
Create a custom SpringMvcContract bean which override processAnnotationsOnParameter method: https://gist.github.com/rmfish/0ed59a9af6c05157be2a60c9acea2a10 |
I dont think this is still an issue. |
@charlesvhe ^_^
server1 - feignRemote:
server2 - controller
|
@eefnrowe thanks |
@eefnrowe With java1.8 sun.net.www.protocol.http.HttpURLConnection or feign-okhttp 10.4.0, I need to empty requestBody like |
@maketubo I changed it to
|
From @wanghongfei on August 12, 2016 4:14
I'm using Feign with Spring Cloud Netflix stack. In SpringMVC we can use POJO as request parameter which is very convenient:
But in Feign I have to write lots of
@RequestParam
:I think it good for feign's user. Thanks!
Copied from original issue: OpenFeign/feign#438
The text was updated successfully, but these errors were encountered: