question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Controller Frombody parameter is null

See original GitHub issue
  • Abp package version : 5.8.0
  • base framework: .Net Core.
        [HttpPost]
        [DisableValidation]
        [DontWrapResult]
        public async Task<IActionResult> Post([FromBody]Update update)
        {
            await _telegramBotAppService.EchoAsync(update);
            return Ok();
        }

I want to handle Telegram Bot with webhook. In a new clean .Net Core solution it works but it not work with my Abp solution.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
dwildcashcommented, Jun 10, 2020

Same problem here. It was working before but stopped working few month ago. Here how I fixed

public async Task<IActionResult> Webhook([FromBody]dynamic jsonresult)
{

            try
            {
                await _updateService.EchoAsync(JsonConvert.DeserializeObject<Update>(jsonresult.ToString()));
            }
}
2reactions
malimingcommented, Jun 8, 2020

Hi @behiunforgiven I will test your steps as soon as possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Post parameter is always null
My solution is to change the [FromBody] to a HttpRequestMessage , essentially moving up the HTTP stack. In my case I am sending...
Read more >
Why is the ASP.NET Core FromBody not working or ...
We have made a JSON request to an API endpoint. However, what do we do when the parameter with FromBody is returning null?...
Read more >
Why your [FromBody] parameter is always NULL
Explanation on the [FromBody] parameter binding with Web API and setting the correct content-type for simple types.
Read more >
ASP.NET Core FromBody: Not working? Or returning null ...
The ASP.NET Core FromBody. Is it not working? Or returning null ? This video will provide a solution to this common .NET problem....
Read more >
ASP.NET CORE Web API: Value are always null when ...
@zzyykk123456 I'm using Postman to test it but it doesn't pass the values even with or without the [FromBody] parameter attribute.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found