Brion Vibber wrote:
Jim Higson wrote:
How can I check if a page exists from a program?
You can hit Special:Export/Pagename; if the response contains no <page> elements, the page does not exist.
Do you know any way that does not involve getting the whole article text?
I've looked at sending HEAD requests to Specail:Export and turned up some unexpected behaviour. Like action=raw, it always returns 200, but for articles with a space in the name you can tell if it is new because Content-Length is always 100.
For articles without a space in the name Specail:Export export never sends Content-Length to HEADs :)
Of course, this isn't reliable at all. Is there any chance action=raw could be made to return 404, or Content-Length: 0 for non-existing articles?
-- Jim