PHP connection doesn't work on device

Hello everyone,
i’m new and i am just trying out a bit with ionic. I tried to make a HTTP Request to a testpage, but it doesn’t work if I test it on the device. Testing in browser it works fine.

import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';

  selector: 'app-login',
  templateUrl: './',
  styleUrls: ['./'],
export class LoginPage implements OnInit {

  constructor(private http: HttpClient) { }

  ngOnInit() {

  login() {
      .subscribe(data => {
        var loginAccepted = data;
        (<HTMLInputElement>document.getElementById("wrongPassword")).innerHTML = JSON.stringify(loginAccepted);


header("Access-Control-Allow-Origin: *");
header('Access-Control-Allow-Credentials: true');
header("Access-Control-Allow-Methods: PUT, GET, POST, DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");

$test = array(
  'msg'    =>  'Hello World.'
echo json_encode($test);

This is how it looks in the browser.
If I run it on my device (Huawei P30 Pro) the text does not appear.

Edit: if I try it with from it works on my device

Edit 2: Solved the Problem, had to use https instead of http