node.js - Node Request Library: Setting the Read timeout -


i have server responds quickly, has grab data external source. believe causing read timeout.

    getsubdevicestatus(){     var parent = this;     let fullurl = this.baseurl + this.getsubdevicestatusendpoint;     console.log(fullurl);     console.log(this.authheaders);     console.log(this.classname+ ": getsubdevicestatus called on device: "+this.deviceguid);     request.get({         headers: this.authheaders,         url:     fullurl,         timeout: 300000,     }, function(error, response, body){         console.log(response.statuscode);         if (!error && response.statuscode == 200) {             console.log("response "+fullurl);             console.log(response.headers)             console.log(body.length);             //parent.subdevices = [];             let json_response = json.parse(body);             //iterate through our updates             }          }else{             console.log(this.classname +": getsubdevicestatus failed.")             console.log(error);         }     }); } 

how manually set read timeout?


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -