Added a function to send data to a server.