© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
4y ago
•
13 replies
SWEETPONY
❔ What should web api controller return?
I can return Ok with some json as parameter
. Or I can return simple string
For example
, I have method in controller
:
[HttpGet("movies")]
public string GetMovies()
=> "12 angry men";
[HttpGet("movies")]
public string GetMovies()
=> "12 angry men";
Is it correct to return just a string
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
✅ Web API Controller Response JObject
C
C# / help
2y ago
What should the service layer return back to a controller?
C
C# / help
2y ago
✅ Implementing delete repository method & controller | Web Api
C
C# / help
13mo ago