I would like to manually send the HTTP 40x error code to the client from the web method in the C # asp.net web service .
In particular, I need to send 400 (invalid request) or 401 (unauthorized).
I thought about the flow as follows:
if (a <= 0) { //send HTTP Error 400 - Bad request to client return; }
Is it possible? How?
To ka source share