The server 405 error is telling you it doesn't like POST operations but would be happy to receive a GET operation from the Arduino and respond to it like it responds to the browser GET.
For starters, change POST to GET here and see if it helps:
The reason I said "for starters" is that there is more to think through and re-code.
The code currently sends data in the post body. That doesn't work for GET requests, which is why you see the complaint about a malformed request. The data has to be part of the url that is sent to the server after GET (where currently just the page is sent).
Read up on HTTP GET requests and you'll see the proper format to send.