Check for type property in httpRequest method to avoid error