-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Describe the bug
I don't have option to set response code. [source code]
In REST with a POST method and a status code of 201 I could send a location header, but it could be 200, 202 or 204.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201
The code is
if err == nil {
switch r.method {
case http.MethodPost:
return http.StatusCreated, nil
case http.MethodDelete:
return http.StatusNoContent, nil
default:
return http.StatusOK, nil
}
}Expected behavior
I can set the response code and headers.
Environments (please complete the following information):
- OS: Linux
- gofr version v1.6.1
- go version 1.22
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels