Add timeout to resource.http_request

I want to add a timeout limit to http_request resource, so that if the request does not return a result within a particular time it fails.