PHP Metadata parameters

Hi, how do I get the `$maxAge, $maxCount and $cacheControl parameters to work in the metadata field for PHP code? These parameters on this form works fine for me: **$requestBody = array(array("eventId" => guid(), "eventType" => "event-type", "data" => 'Request method: ' . $_SERVER['REQUEST_METHOD'] , "metadata" => "test",));** But when I add this to the metadata field like this: **"metadata" =>** array(array(“maxAge” => 100 , “maxCount” => 2 , “cacheControl” => 2,))

the whole metadata field disappears in the event in Event Store.
It does not seem to work either. Because I can write more then two events to specific eventstream and the eventstream doesn´t appear after 100 seconds.

How should I write this line to get the parameters to work for the metadata field?
`

They need to be prefixed by a $, you’ll likely need to escape this in PHP or use a string type which doesn’t allow for interpolation

Yes thanks, I have tried with prefixing with a $. But I don´t get it to work. Can you give me a code-example for this that works for PHP?

Is there anyway to show us what is going out over the wire?

As I said before:
`the whole metadata field disappears in the event in Event Store when I execute the code.

Over the wire, do you mean while the program executes?
`

`the whole metadata field disappears in the event in Event Store.

It does not seem to work either. Because I can write more then two events to specific eventstream and the eventstream doesn´t appear after 100 seconds.

`

Are you getting back 201 Created from your requests?

Basically the raw http request.

eg using something like fiddler to show us what you are actually posting to the event store

Also

$maxAge and $maxCount are stream metadata fields not to be put on individual events. To post stream metadata you should :

GET root of feed eg /streams/foo

in this document there is a rel link “metadata”

POST to what that rel link is.

Cheers,

Greg