Asterisk manager api - Missing action in request

I encounter a strange problem wrt the manager api: the first call (e.g. login) works, all subsequent calls return "“Missing action in request” though ACTION is there:

[code]ACTION: LOGIN
USERNAME: foo
SECRET: bar
.
Response: Success
Message: Authentication accepted

ACTION: Command
command: show dialplan
.

Response: Error
Message: Missing action in request[/code]

I have the same problem. Using

Action: Login
Username:
Secret:

But when I return twice, I get the “Missing action in request” error, and after a few seconds the connection is simply closed…

What am I doing wrong? I want to test a few commands that we will be putting into PHP scripts to run AMI commands against our Asterisk server from a proprietary web application (also in PHP)