-
Notifications
You must be signed in to change notification settings - Fork 1.3k
add Created
helper type
#3495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add Created
helper type
#3495
Conversation
add `Created`, a helper type that forces the user to set a `Location` header when returning 201 CREATED
add `Created`, a helper type that forces the user to set a `Location` header when returning 201 CREATED
The doc comment mentions that 201 is recommended to have a
I don't see that as a recommendation to be honest, it just states, that if you send the header, it has special meaning but not that you SHOULD send it. |
Even though I read the part you mentioned to make this contribution, yeah it doesn't use the keyword which is probably an indicator you're right. Looking it up again though it says this under POST:
If you guys think this change is worth is is frankly up to you, I just wanted to get this out because I use it in my project and found it useful |
Right. In that case it does make sense but I think there should also be a way to explicitly create the response without the header. So I think having constructors like Maybe other maintainers will have different opinions though. |
can you even do at_request_path? Or do you mean like to give a URI as an argument? |
I meant it as with the implicit location, at which the resource was created, which is the request URI. The name I came up with might not be as clear as it should be.
|
add
Created
, a helper type that forces the user to set aLocation
header when returning 201 CREATEDMotivation
When looking at how to guarantee the CREATED status code's semantics I came up with this, maybe it's helpful.