Monday, November 08, 2010 at 12:06 AM.


on httpGetStatusCode (httpResult) {
		<<8/6/08; 8:31:29 AM by DW
			<<Return the status code of the HTTP request, something like 200, 301, 404, etc.
	return (string.nthField (httpResult, ' ', 2))}
<<bundle //test code
	<<dialog.alert (httpGetStatusCode (tcp.httpClient ("HEAD", ""))) //200
	<<dialog.alert (httpGetStatusCode (tcp.httpClient (server:"", path:"hitler"))) //404

This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.