It would have been nicer to use REST instead. For instance a HEAD HTTP request to

    /xwiki/rest/wikis/xwiki/spaces/Spage/pages/Page

could have told you if the page exists and also if you have view rights on it. Indeed, currently there's no way to check edit right using REST (should be double checked though) so your implementation would be incomplete.

Another thing I don't like is the plain text response. I much prefer JSON, even if in this case the response size would be a little larger (but insignificantly larger IMO).