commercetools / commercetools-jvm-sdk

The e-commerce SDK from commercetools running on the Java virtual machine.
https://commercetools.github.io/commercetools-jvm-sdk/apidocs/index.html
Other
62 stars 40 forks source link

Client plusHeader and withHeader methods #1602

Closed heshamMassoud closed 6 years ago

heshamMassoud commented 6 years ago

It would be great to be able to add additional user- specified headers to the sphere client that it could append to all of the requests it makes.

One use-case, for example, would be in the commercetools-sync-java library, where the library would append to the client the library version headers, so that all the requests made by the users can be monitored for example over Kibana and know who uses the library and what version they are using.

heshamMassoud commented 6 years ago

Hi @katmatt, do you think this feature would have any side-effects or is it fine to have in the JVM SDK? and any idea about when it could be there already in the JVM SDK?

I would really love to make a PR for it, however, I am pretty busy with the commercetools-sync-java 😢

acbeni commented 6 years ago

Actually this can be achieved via making a SolutionInfo provider. So i think it would be enough for your need @heshamMassoud

katmatt commented 6 years ago

@heshamMassoud As far as I know you already implemented the SolutionInfo provider. And I don't think that it makes a lot of sense to add the plusHeader and withHeader without an actual use case. So I would suggest to close this issue.

heshamMassoud commented 6 years ago

@katmatt yes, for now the SolutionInfo is enough.