lohithKumar95
lohithKumar95

Reputation: 1

Response with status:0 for URL:null when i am making a rest from ios ionic app

I am making a rest call from ionic app and its working in android device but not in the ios device. This is how i am making a rest call from my ionic service.

import { Http } from '@angular/http';
import { Injectable } from '@angular/core';

@Injectable()
export class loginService {
    constructor(private http : Http){ }
    getAllUsers(authData){
        console.log(authData);
        return this.http.post('http://Some IP add:8080/api/customerr/getUser', authData);
    }
}

This is how I am receiving the data in my login.ts file

this.loginservice.getAllUsers(this.loginForm.value).subscribe((response) => {
    this.loginResponse = response.json()
} (err)=>{
    alert(err)
});

Upvotes: 0

Views: 486

Answers (1)

Mano Mahe
Mano Mahe

Reputation: 106

Finally… I solved this problem by changing the API URL call from "http://yourapiurl/" to "https://yourapiurl/" and That sounds good. Please try this one.

I got this from here, Reference

Thank you.

Upvotes: 1

Related Questions