Starts in:
1 DAY
8 HRS
4 MIN
21 SEC
Starts in:
1 D
8 H
4 M
21 S
Open Closed

Different HTTP status code from application layer #5686


User avatar
0
sukhdeep.dhillon created
  • ABP Framework version: v6.0.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)

Hi, how can I return different http status code from application layer methods.

for example, for post request, ABP by default returns 200 but I want to return 201.

how can I do that in application layer without going thru controllers.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Unfortunately, you can't do this, because the application layer can't access httpcontext.

    You can write a middleware to modify the http status code.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06