Should I use custom headers or useragent header to

2020-06-16 04:21发布

问题:

Every time I send a API request to my server I want send informations like device type and OS version (from my mobile app). My first thought is to use User Agent but I wonder if there's any benefits to use custom http header like "X-deviceType" or/and "X-osVersion" instead.

回答1:

I am using the X-Device HTTP Header.

Works well for the most part, however I have noticed that some requests from behind a proxy seem to be stripping the data from that header.