How to check if a URL is accessible or not?
in
Programming Questions
•
3 months ago
I am trying to read json from a URL, but when the link is not found, the sketch prints errors (though the program is not interrupted). How can I check if the URL is accessible or not? I am using the following code, but it doesn't work:
- if (loadStrings(request)==null) {
- println("Link broken");
- }
- else{
- //do something
- }
1