Strange API response encoding

simora 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

simora 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 Tananaeva year ago

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

simora year ago

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

Anton Tananaeva year ago

If you want JSON - yes.