Error import sqlite

I’m integrating a SQlite database by following this tutorial
I receive the following message:
Block-scoped variable ‘Headers’ used before its declaration.
return new Promise((resolve, reject) =>{
let Headers = new Headers() ;

I’m looking for it and I can not find a way to fix it.
my code:

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import { FilePath } from '@ionic-native/file-path';

import { HttpHeaders } from '@angular/common/http/src/headers';

let apiUrl = "http://localhost/PHP-Slim-Restful/api/";

  Generated class for the AuthServiceProvider provider.

  See for more info on providers
  and Angular DI.
export class AuthServiceProvider {

  constructor(public http: HttpClient) {
    console.log('Hello AuthServiceProvider Provider');

  postData(credentials, type){

    return new Promise((_resolve, reject) =>{
    let HttpHeaders = new HttpHeaders() ;, JSON.stringify (credentials), HttpHeaders).subscribe(res =>{(response =>
      }), (err) =>{

merci d’avance


I have no idea what the connection is between the code you posted and SQLite, but if you got that code from the video you linked, my advice would be to find another source of guidance, because what you have posted is an antipattern casserole of needlessness. For HTTP, I would start here.

in fact I had already followed the first tutorial he had done for the creation of login page and I wanted to follow with this tutorial for the registration of data provided by the user of the app

I see less than zero value in continuing to follow sources of bad code simply for the sake of familiarity, but it’s your career, not mine.

it’s not for familiarity :wink: but as the first tutorial gave me the result that I wanted I thought that the sequel would also be good but it is not the case.
so I’m going to look for another tutorial for the database

I’m still unclear about the relationship between SQLite and the code you have posted, which seems to be trying to authenticate over HTTP.

One thing to keep in mind is that you cannot do authentication on device: SQLite on the same device as your app is completely useless for authentication purposes.

I will explain a little how I need my app.
1st page connection, 2nd page different information that the person must fill in, a button to save everything that will save in the database (to be able to be consulted by the user when he wants it via another page) and send by mail to a certain address.
here in general.