Fix problems sending JSON payload to website.

This was caused by the use of 'send' which is not designed to handle
non-blocking sockets.