Error check for httpRequest method