ID:260075
 
Is there any way the world.Export function can be allowed to continue if a status other than 200 is returned? I'd rather handle the HTTP status myself.

Instance where this would be useful: Tiberath is trying to make a proc that would check for the existance of a key (what for I'm not entirely sure yet), but because of the auto-redirect on member people pages it returns 302 and runtimes.
mob
verb
key_exists(T as text)
if(T)
var/page[] = world.Export("http://developer.byond.com/people/[T]")
if(length(page) && page["STATUS"] == "200 OK")
var/body = file2text(page["CONTENT"])
if(findtext(body,"The key '[T]' is not registered.")) world << "Not registered"
else world << "Is registered"
else if(findtext(page["STATUS"],"302")) world << "Is registered" //must be a member page
The closest thing I managed to get for what I wanted was:

proc
key_exists(msg as text)
var/page[] = world.Export("http://members.byond.com/[msg]")
page = file2text(page["CONTENT"])
if(findtext(page,"Joined")) world << "regestered"
else world << "Not Regestered"


I had to use "Joined" because it's the only thing Member and Non Member pages have in common that isn't in common with the rest of BYOND Members site. If the key doesn't exist, it just displays the BYOND Members main site, and I'm bonned if someone posts a blog with the world Joined in it (and chances are high).