Say my filepath is
http://server/subsite/library/folder/file.png. If I need to get information about a file, I need to do the following:
Now the problem is I don't know which sections are the subsite(s), so I have to run the follow
_vti_bin/webs.asmx/WebUrlFromPageUrl which will get me the web url. So for the above filepath it will return
http://server/subsite and now I have the required context for the REST _api.
Is there an easier way of doing this? I'm relying on the REST api and the I know the asmx handlers are very old and deprecated. I don't mind doing two requests to get the information I want but is there a REST equivalent of
Edit: I am calling the sharepoint rest api from an external service. It is not a sharepoint app.