Strange API response encoding

simor a year ago

Hi,

While trying to evaluate the APIs exposed on the demo server (demo.traccar.org) in Postman, when I call the endpoint api/reports/trips with the parameters "deviceId", "from", and "to", I receive a 200 status code, but the response body is not in JSON format. Specifically, I get something like the following:

Postman screenshot

Am I doing something wrong?

Best regards,
Simone

simor a year ago

[More infos:] I'm using basic auth as authorization and I'm sure is well defined because others endpoints work with that.

Anton Tananaev a year ago

You forgot to provide the Accept header to indicate the format you want.

simor a year ago

By default in Postman is setted to */*
should it be application/json ?

Anton Tananaev a year ago

If you want JSON - yes.