Check this below service code.
import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions, URLSearchParams } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { DataJson } from "../models/dataJson";
import { AppSettings } from '../app.settings';
@Injectable()
export class StepsServices {
constructor(private http: Http) {}
postGetPanelists(params, token): Observable {
debugger;
let tokenHeaders = new Headers({
'Authorization' : 'Bearer '+token,
'Accept': 'application/json',
});
let tokenOptions = new RequestOptions({ headers: tokenHeaders });
return this.http.post(AppSettings.BASE_API_URL+'demo/demo/', params, tokenOptions)
<