Bad credentials while using HttpClient Post

i have REST API in symfony 3.4 with lexikjwt authentication and FOS bundle. When i do a post request to :

curl -X POST -d _username=username -d _password=password

a token is generated correctly as expected. Also when i enter the username and password in localhost:8000/login, a token is also generated.So the API is working. But when i try to send a request from my angular 2 frontend using HttpClientModule using this code :

 let body = new HttpParams();
   let headers = new HttpHeaders().append('Content-Type','application/x-www-form-urlencoded');'http://localhost:8000/login_check',{body},{headers : headers}).subscribe(data => {

I have an error {{code : 401 ,message : "Bad credentials"}}. But When i use a generated token to make a GET request :

let headers = new HttpHeaders().append('Authorization','Bearer Some_token');
this.http.get('http://localhost:8000/api/mydata',{headers : headers}).subscribe(data => { console.log(data)

I got the right Json response.

My nelmio_cors config:

        allow_credentials: false
        allow_origin: []
        allow_headers: []
        allow_methods: []
        expose_headers: []
        max_age: 0
        hosts: []
        origin_regex: false
                        allow_origin: ['*']
                        allow_headers: ['*']
                        allow_methods: ['POST', 'PUT', 'GET', 'DELETE','OPTIONS']
                        max_age: 3600
                        origin_regex: true
                        allow_origin: ['*']
                        allow_headers: ['*']
                        allow_methods: ['POST', 'PUT', 'GET', 'DELETE','OPTIONS']
                        max_age: 3600

I wonder why my post request is not working. I tried to look an answer to this but to no avail.