android - How to check OS of the device making the api request? -


i have android , ios app. want check @ backend programmatically api requests coming app android app or ios app i.e. want check platform/ os of user's device? possible?

you can way on backend.

 import javax.ws.rs.get;  import javax.ws.rs.headerparam;  import javax.ws.rs.path;  import javax.ws.rs.core.response;  @path("/users") public class userservice {  @get @path("/get") public response adduser(@headerparam("user-agent") string useragent) {      return response.status(200)         .entity("adduser called, useragent : " + useragent)         .build();      }  } 

output:

adduser called, useragent : mozilla/5.0 (windows nt 6.1; rv:5.0) gecko/20100101 firefox/5.0 

copied mykong


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -