You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I’m using refit with a multipart upload endpoint, and I’m running into an issue when trying to send the same value in both the form body (so it binds into my model) and as a custom header
I did [AliasAs("foo")][Header("FooHeader")] long fooId, hoping it would bind it to both the FromForm and the Header.
What I observed from the controller was that I get the correct value in the Header, but the value coming from the FooRequest.Foo (from [FromForm]) is coming as 0. I was expecting both to have the same value.
This however worked when my Foo is a path param instead of [FromForm]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I’m using refit with a multipart upload endpoint, and I’m running into an issue when trying to send the same value in both the form body (so it binds into my model) and as a custom header
Here is what I had tried
I did
[AliasAs("foo")][Header("FooHeader")] long fooId,hoping it would bind it to both the FromForm and the Header.What I observed from the controller was that I get the correct value in the Header, but the value coming from the
FooRequest.Foo(from[FromForm]) is coming as 0. I was expecting both to have the same value.This however worked when my Foo is a path param instead of [FromForm]
Any suggestions?
Thanks in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions