Have an error message "Failed to derive xcontent from org.elasticsearch.common.bytes.ChannelBufferBytesReference", why?

I used bulk api with php, but met a problem:
{"error":"Failed to derive xcontent from
org.elasticsearch.common.bytes.ChannelBufferBytesReference

here is my curl command:
curl -s -XPOST localhost:9200/_bulk --data-binary @requests;

php code:

<?php $method = "POST"; $url = "http://localhost/_bulk"; $data = array('file' => '@requests'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_PORT, 9200); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method)); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $result = curl_exec($ch); curl_close($ch); print_r($result); --

You send an empty file. Check the file name usage.

Jörg

--

I think you are right. But how to fix my php code's bug?

在 2012年12月24日星期一UTC+8下午9时45分14秒,Jörg Prante写道:

You send an empty file. Check the file name usage.

Jörg

--