Skip to content
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

If you don't write BodyAttribute buffered=true webapi can't request body #404

Closed
softlgl opened this issue Dec 28, 2017 · 4 comments · Fixed by #434
Closed

If you don't write BodyAttribute buffered=true webapi can't request body #404

softlgl opened this issue Dec 28, 2017 · 4 comments · Fixed by #434
Assignees
Labels
Milestone

Comments

@softlgl
Copy link

softlgl commented Dec 28, 2017

i don't write BodyAttribute buffered=true , webapi can't request body like this

this is interface code

[Post("/api/Login/Login")]
[Headers("Content-Type:application/json")]
Task<ApiResponse<User>> LoginAsync([Body]LoginDto loginDto);

this is webapi action

[HttpPost]
public ApiResponseBase<User> Login(LoginDto loginDto) { }

but loginDto is null ,If it does‘t contain buffered=true

this is test code

var loginApi = RestService.For<ILogin>("http://localhost:10452");
ApiResponse<User> userRsp = await loginApi.LoginAsync(new LoginDto { LoginName = "test", LoginPwd = "test" });

@clairernovotny
Copy link
Member

Hi,

Is there a question here? I'm not following, sorry.

@bennor
Copy link
Contributor

bennor commented Jan 30, 2018

I wonder if we should make buffered=true the default? Seems like the streaming added in 4.0 causes problems for more people than it solves and it should be opt-in.

@clairernovotny
Copy link
Member

Not a bad idea, streaming is likely only useful for large streams. I'd actually prefer a refit settings level option to turn it on/off by default rather than having to go more granular.

@nathanbedford
Copy link

+1
Just spent a few hours debugging this, since in my case Web.API only occasionally failed to bind the incoming model. I would much prefer to opt-in to streaming.

@clairernovotny clairernovotny added this to the 4.2.1 milestone Feb 4, 2018
@clairernovotny clairernovotny self-assigned this Feb 4, 2018
@clairernovotny clairernovotny modified the milestones: 4.2.1, v4.3 Feb 16, 2018
@lock lock bot added the outdated label Jun 25, 2019
@lock lock bot locked and limited conversation to collaborators Jun 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants