paylike / php-api

A PHP client for accessing the API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add `X-Client` header

tjconcept opened this issue · comments

Add a HTTP header containing the client type and version along the lines of the one on the Node.js API: https://github.com/paylike/node-api/blob/master/src/index.js#L68

It helps me analyse how fast people upgrade and which clients are used the most.

@ionutcalara, I noticed you merged a PR with something like this, but apart from the PHP version, what I'm more interested in is the version of the client (this library). It's so that I can estimate the impact of a breaking change in the API.

Feel free to add me as a reviewer on PRs concerning issues raised or discussed with me before merging 🙂

Should i change the X-Client to the version of the api? Is there a naming convention for this headers? According to https://tools.ietf.org/html/rfc6648 the X prefix is no longer recommended. I will add you as a reviewer, i merged because i wanted to have the bug fixed.

I would like it to be: "PHP x.x.x phpversion()"

That RFC was an interesting read, I didn't know about it.

However, regarding our header, it also says:

In some situations, segregating the parameter name space used in a given application protocol can be justified:

When it is extremely unlikely that some parameters will ever be standardized.