I'm creating an ASP.NET Web API application that will be accessed by mobile clients. I would like to use the client's User-Agent
header to determine whether I should allow the client to connect to my server/API or to ask them to upgrade their client version.
To give a simple example, the client sends User-Agent: ClientV5
with every request. If the server considers ClientV5 to be out-of-date, wrong, etc., I'd like my server to reject the request and return a response along the lines of "Please upgrade your client to the latest version".
Is this a "misuse" of the User-Agent
header, especially since this header will probably be set by the mobile web views on the various mobiles OSs?
Note that I do not want to keep older versions of my API available (/api/v1/..., /api/v2/..., etc.).