Search This Blog

Tuesday, January 14, 2014

HTTP URL Validity Check in Nodejs

Http URL Validity can be checked in 2 ways.
  • Using a regular expression to check if the pattern matches
  • Ping to that URL and see if there is a response or not i.e. if it exists or not.
Some times, the pattern matches but the the required URL may be or may not be existing. In order to check this in NodeJs, 'request' module can be used. Both the steps can be done in a single call.