Inside of a method how can I dynamically change the response code to 201? I know for something like a 204 I can just throw a RestException of that, but with a 201 I still need to return data.
Inside of a method how can I dynamically change the response code to 201? I know for something like a 204 I can just throw a RestException of that, but with a 201 I still need to return data.
You can use
@statuscomment for this purpose.You can see how it works on the documentation example