If there is no response from the server

How can I make sure that if there is no response from the server, then it was sent unsuccessfully?