Facing Unsupported Media Type

imran4 years ago

Hi, I am trying to add driver and group adding traccar api with angular 10 frontend, but facing problem showing message "Unsupported Media Type"

Anton Tananaev4 years ago

You are probably using wrong content type, as the error indicates.

imran4 years ago

Thank you for your quick response.please show me format with example for adding driver, I have read documentation for adding driver but could not insert data. Is it required to send session id with every request. If it is needed, how should send .

Anton Tananaev4 years ago

Check the request from the official web app.

imran4 years ago

If i send header like ..

private setHeader(token: string) {
  let headers = new HttpHeaders({
    'Accept': 'application/json',
    'Content-Type':'application/json',
    'authorization':'Bearer ' + token
  });

  this.options = {
      headers: headers
  };
}

will get session id server correctly