Start a new topic

Get os version from request (x-kinvey-device-information)

Hi,



I'm trying to fetch the value of the x-kinvey-device-information header (example: "x-kinvey-device-information":"iPhone Simulator/x86_64 iPhone OS 8.0"), I can't find any way to pull it from the Request object.



```

@POST

public CommandResponse handleBLRequest(@PathParam(KINVEY_COMMAND) String command, Request request){

LOGGER.info("command: " + request.getCommand());

LOGGER.info("http action: " + request.getHttpAction());

LOGGER.info("kinvey action: " + request.getKinveyAction());

LOGGER.info("args: " + request.getArguments());

LOGGER.info("platform: " + request.getArguments().getKinveyAppMetadata().getPlatform());

LOGGER.info("id: " + request.getArguments().getKinveyAppMetadata().getId());

LOGGER.info("name: " + request.getArguments().getKinveyAppMetadata().getName());

LOGGER.info("api version: " + request.getArguments().getKinveyAppMetadata().getApiVersion());

```



results in

```

command: customEndpoint

http action: POST

kinvey action: Save

args: com.kinvey.business_logic.CollectionArguments@1dd6ab4

platform: null

id: XXXXXXXXXX

name: XXXXXXXX

api version: null

```



I assumed this would come through in getPlatform(), but is there another way to access it? Thanks in advance.
1 Comment

Hey,



are you making this request through console.kinvey.com, the REST api, or through one of the Client libraries?



Try printing out the values in this hashmap, which will you show all the headers on the request:



HashMap headers = request.getArguments().getKinveyRequest().getHeaders()



Also, just so you know our (BETA) Business Logic SDK is open source, so feel free to take a look: https://github.com/Kinvey/Kinvey-Business-Logic-SDK
Login or Signup to post a comment