Check for type property in httpRequest method to avoid error

This is fixing the same issue that stevenmaguire submitted in PR#8, but now is contained on one line of code as requested. Thanks!