Ionic HTTP POST reply net::ERR_NAME_NOT_RESOLVED

Why aren’t you using the ionic-native shim?

Thanks for the reply rapropos, I didnt know about that. I will try it now and reply how it goes. I have taken a lot of guidance from your work :slight_smile:

Well, I can’t understand this plugin. I am trying like following, is it suppposed to access the page like this?

public options = {
action: this.webIntent.ACTION_GET_CONTENT,
requestCode: 200,
url: ‘http://page.local:80/’,
type: ‘text/plain’
};

this.webIntent.sendBroadcast(this.options).then(onSuccess => console.log(onSuccess), onError => console.log(onError));

I suggested you to install this https://github.com/sneas/ionic-native-http-connection-backend and then use Angular’s HttpClient as you’d usually do

hey, I will try that now. This issue has taken a lot of days :frowning:

Kyrax, I tried with the naative http. I think the error is same, it is below.

image

@rapropos any idea how do i solve this?

Is this suitable for the android device also? I am facing some issue on my Android device. I have visited Asus Error Code 55 but didn’t get any suitable solution.

Hi sorry i didnt see your comment before. In arduino i have the following code.

 HTTP.on("/status", HTTP_GET, []() {
            HTTP.sendHeader("Access-Control-Allow-Origin", "*");
            HTTP.send(200, "text/plain", "ok");
        });

in ionic i have the following headers:

let headers = new Headers();
    headers.append('Content-Type', 'text/plain');

My http post in ionic is below:

this.http.post(this.global.url, JSON.stringify(body), { headers: headers }).subscribe(data => { }, error => {});

Hi @nomanshah even I am facing same error , the mdns works in browser but does not work on android device

Solved my problem using
Zerconf native

Use zeroconf.watch and obtain ipv4 address from it , then use this address to call i.e this.get(ipv4 address,{},{}).