禁用跨域调用[关闭]

I was wondering weather there's a way to block other domains from sending POST and GET requests to my domain. I cannot trust the end users to not do such things and I know same origin policy can be bypassed. Is there any useful method to block/handle requests coming from other domains?

No, it isn't possible.

You can stop a third party site from tricking one of your users into submitting bad data using the usual defences against cross-site request forgery.

You can't prevent the request being made in the first place, and you can't tell the difference between a request made by a browser and one made by a non-browser user-agent running on a website (although you can implement, for example, ip address based rate limiting).