Further to Ole’s general comment, just create a hidden endpoint page that returns JSON/XML/whatever and hit it.