Get Subscribe Data out of function

I resolved it with this:

1- Getting data:

      xmarkSolicitud(idTran:string, stagePos:string){
        let urlEndPoint=this.urlApi+idTran+'/stages/'+stagePos+'/mark';
//Creating the promise
        return new Promise((resolve, reject) => {
            this.http.post(urlEndPoint,'',{headers:this.headers}).subscribe(
                res=>{
                  console.log('Mark Transaction OK, idTransac='+idTran);
                  resolve(res); //value to return out of the promise
                },(err: HttpErrorResponse)=>{
                  reject(err); //returning Error
                  console.log(err.error);
                  console.log(err.name);
                  console.log(err.message);
                  console.log(err.status);
                }
              );
        });//end Promise
      }//end xmarktype or paste code here

2- Using the data:


       this.medService.xmarkSolicitud('617163c535e03f82a19daeaf73e5547c','0').then(resp=>{
       console.log(resp);
//make your stuff with the response (resp)
     }, error=>{
//manage error
       console.log(error);
     });