do_request function

performs the request