I want to have the myFunction() send a payload which will be processed by the doPost and return some content based on the payload. I can only get these test scripts to work
The problem appears to be that the domain "script.googleusercontent.com", which is where ContentService content is served from, doesn't allow the POST method. When your doPost() handler returns the TextOuput it sends a redirect back to the client, which causes the client to send the POST again to script.googleusercontent.com, which is not allowed.
If you can use GET then that would be the recommended solution. If not, you may need to split the work into two parts: first POSTing with no response, then GETting to retrieve the response.
Update: As of Sept 21, 2012 this problem should now be fixed, and you can POST to the URL without any errors.