Using REST_Controller Codeigniter API with key-Collection of common programming errors

Here is my code for my PHP application to access the CI Rest Library by Phil sturgeon. When I disable the api key it seems fine. This is the json result as follows:

[{"groupID":"1","listID":"1","groupTitle":"GroupA","groupName":"Group Name 1"}]

And when I try enabling the api key in rest library. I receive this

{"status":false,"error":"Unknown method."}

Trying also on my terminal:

I got this

CURL

[2012-07-03 14:11.42]  ~
[User4001.me] ? curl -X POST -H "X-API-KEY: 221b368d7f5f597867f525971f28ff75" http://localhost/mailapi/index.php/api/group/id/1
{"status":false,"error":"Unknown method."}   

ON PHP
test.php

$ch = curl_init();
curl_setopt_array($ch, array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_URL => 'http://localhost/mailapi/index.php/api/group/id/1',
    CURLOPT_POSTFIELDS => 'X-API-KEY=221b368d7f5f597867f525971f28ff75'
));
$response = curl_exec($ch);

echo"
";
print_r($response);
echo"
";

Am I missing something?