Before access res fields, it must be checked against nil, since send_request_cgi can return nil in case of timeout: