The application completed without reading the entire request body, .net core 2.1.1

后端 未结 10 1354
-上瘾入骨i
-上瘾入骨i 2020-12-14 07:21

I have created a user register controller to register users with repository design pattern. My controller looks like this.

[Route(\"api/[controller]\")]
             


        
相关标签:
10条回答
  • 2020-12-14 07:43

    I spent hours on this. My problem was that I had:

    [HttpPut("{matchGuidStr}/join")]
    public async Task<IActionResult> JoinNewMatch (string matchGuidStr) {
    

    instead of:

    [HttpPut("{matchGuidStr}/join")]
    public async Task<IActionResult> JoinNewMatch (string matchGuidStr, [FromBody] Payloads.JoinGamePayload payload) {
    

    basically, my route didn't care about the request body at all (intentionally) but I needed to still pass it as a parameter. yikes!

    0 讨论(0)
  • 2020-12-14 07:44

    In my case, was the query wrong:

    SELECT * FROM dbo.person WHERE login= 'value' && pass = 'value'
    

    Solved after fix && wrong AND ok

    SELECT * FROM dbo.person WHERE login= 'value' AND pass = 'value'
    
    0 讨论(0)
  • 2020-12-14 07:48

    i have same error, check maybe you put (AutoValidateAntiforgeryTokenAttribute) in AddMvc Services

    services.AddMvc(opt => {
    
                //Prevent CSF Attake For POST,PUT,DELETE Verb
                //opt.Filters.Add(new AutoValidateAntiforgeryTokenAttribute());
            })
    
    0 讨论(0)
  • 2020-12-14 07:51

    Had the same issue running a Dotnet 2.2 and NGinx on remote Ubuntu 18.04-machine, got a:

    .. . the application completed without reading the entire request body

    on every API-call. What solved it for me was to install the SSL Certificates on the host through CERTBot from Let's encrypt, since Dotnet doesn't allow un-encrypted traffic.

    Hopes this helps someone

    0 讨论(0)
提交回复
热议问题