Detecting if resource exists and throw if not

Sadly, depending on the provider the status codes different. For instance, 204 is the normal return code for a delete operation on the sql provider, while on websites the normal is 200 and 204 means not exists.

So, for now, the way to go, seems to be this one (this is what PS does as well).