How to get json data to variable?

Im trying to get my json data to array and i need to control it how can i do that can u guys please help me ?

  login()
  {
    let hash = CryptoJS.SHA256(this.user_password).toString(CryptoJS.enc.Hex);
    let data:Observable<any>;
    data = this.http.get('localhost/api/?loginUn='+this.user_name+'&password='+hash);
    data.subscribe(result=>
      {
        this.items = result;
      })
    if(this.items['state'] == "yes")
    {
      console.log("data");
    }
    else
    {
      console.log(this.items);
      console.log("no data");
    }
  }

json data

{"state":"yes"}

Please fix this API to accept POST or PUT requests instead of GET for logging in. You don’t want sensitive data like authentication information exposed in URLs, and logging in does not constitute “retrieving a resource” as is appropriate for a REST GET action.