❔ api doesn't return anything.
GitHub
GitHub - emt2dev/MandalorianAPI: building a rest api for mandalorians.
building a rest api for mandalorians. Contribute to emt2dev/MandalorianAPI development by creating an account on GitHub.
5 Replies
so you're getting a 200 but no response data?
well you could use
public async Task<IActionResult<Mando>> Index()
also don't use JsonConvert.SerializeObject, just return BoKatanKryzeyes that is correct. keep in mind this is my first api that i've thrown together without any help.
tyvm. may i ask why the weahther controller sends an ienum but forsome reason im choosing to send an iactionresult like mvc?
Task<IActionResult<Whatever>>
is more explicit than Task<Whatever>
, but for the most part the latter will be converted into the former anyway
The IActionResult
part, though, lets you return... action results. Like Ok()
or NotFound()
Besides just returning the desired object
(also, uninstall Newtonsoft, with System.Text.Json
being a thing now, it's basically useless)Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.