title: query string format input UserId and password
body: <p>I need a this format Url:</p>
  
  <pre><code>http://localhost:8089/api/Logins/CheckPassword?ID=[UserID]&amp;Password=[Password]
  </code></pre>
  
  <p>My code does not work:</p>
  
  <p><strong>loginComponent.ts</strong></p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Router, ActivatedRoute } from '@angular/router';
  import { FormBuilder, FormGroup, Validators } from '@angular/forms';
  import { Observable } from 'rxjs';
  import { LoginService } from '../login.service';
  import { Login } from '../login';
  
  @Component({
    selector: 'app-login',
    templateUrl: './login.component.html',
    styleUrls: ['./login.component.css']
  })
  export class LoginComponent implements OnInit {
  loginForm: FormGroup;
  loading=false;
  submitted=false;
  url: string;
     constructor(
       private formbuilder: FormBuilder, 
       private loginService: LoginService,
       private router:Router,
       private route: ActivatedRoute
        ) {
          if(this.loginService.getLoginById)
          {
            this.router.navigate(['/']);
          }
         }
     ngOnInit() {
        this.loginForm = this.formbuilder.group({
          Id: ['', [Validators.required]],
          password: ['',Validators.required]
      });
     }
    get f()
    {
      return this.loginForm.controls;
    }
     onFormSubmit() {
    this.submitted=true;
    if(this.loginForm.invalid)
    {
      return;
    }
    this.loading=true;
    this.loginService.getLoginById()
    //.pipe(first())
    .subscribe(
      data =&gt;{
        this.router.navigate([this.url]);
      },
      error =&gt;
      {
        this.loading=false;
      });
      }
  }
  </code></pre>
  
  <p><strong>loginService.ts</strong></p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClient, HttpParams } from '@angular/common/http';
  import { HttpHeaders } from '@angular/common/http';
  import { Observable } from 'rxjs';
  import { Login } from './login';
  
  @Injectable({
    providedIn: 'root'
  })
  export class LoginService {
    constructor(private http: HttpClient) { }
         getLoginById(): Observable&lt;any&gt;{
          const _params=new HttpParams();
      _params: _params.set('ID=','UserID');
      _params: _params.set('Password=','Password');
      return 
      this.http.get('http://localhost:8089/api/Logins/CheckPassword?', 
     {
        params:_params
      });
      console.log(_params);
      }
    }
  </code></pre>