Skip to content

Instantly share code, notes, and snippets.

@kasperpeulen
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kasperpeulen/42cddc9a1a9abd71eae6 to your computer and use it in GitHub Desktop.
Save kasperpeulen/42cddc9a1a9abd71eae6 to your computer and use it in GitHub Desktop.
Url Exists
import 'dart:html';
main(){
urlExists('https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/autofocus');
urlExists("https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement");
}
urlExists(String url) async {
try {
await HttpRequest.getString(url);
print(true);
} catch(error) {
print(false);
} // examine response for errors
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment