I try to make a request from my php code to another remote server which has Riak DB running. I need to make a map-reduce request so I have to do it with POST http.
Riak documentation says (for e.g.)
curl -XPOST http://`localhost`:8091/mapred \
-H 'Content-Type: application/json' \
-d '{
"inputs":"training",
"query":[{"map":{"language":"javascript",
"source":"function(riakObject) {
var m = riakObject.values[0].data.match(/pizza/g);
return [[riakObject.key, (m ? m.length : 0 )]];
}"}}]}'
How to do the same with PHP?