204 return status -- good or not?

This might go into the domain of "good manners", but I'm not sure.

I'm using a POST request to send some data to my XData service, and it's working as expected.

But the return status is "204 No Content"

I'm not actually detecting any errors so that's all that's ever going to get returned for this method unless I get some kind of catastrophic error like running out of disk space or the disk fails.

Because I'm the only one using this API, I'm sure it doesn't matter, but ... is this OK? Or is it recommended to explicitly return a "200 OK" status instead?

Any status code between the range 200 and 299 is a success status, meaning the request was successfully processed.

XData automatically returns 204 (instead of 200) if the service operation method is a procedure instead of function, i.e, if it doesn't return any value. If you don't have any really strong reason for changing it, you can leave as is, it's a normal response.

Ahh, that's great to know. I'll leave it as-is. Thanks!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.