Curiously, you have two connections to the server - while I don't think it's causing your problem, you should get rid of the first one. It's wasted effort to open the connection, only to close it and reopen it again in the next statement. The timeout response from the server makes sense, it's waiting for the rest of the POST request. A properly formatted request starts with the verb/URL/HTTP version, which you have, along with several request header lines. But after the request headers, you need to send a blank line and then the request body, neither of which are there. The server is waiting for the rest of your request, and finally giving up after waiting too long. What you have can be made to work, but it's a rather cumbersome way to do it. The Yun includes a powerful Linux system with many helpful utilities. Rather than implement all of the details of the HTTP protocol yourself, consider using a Process object to call the curl command on the Linux side. It will make things easier and handle a lot of the details for you.