Web Component Help

hi, i am facing a problem and i need help, the problem itself is the following, as it is in the photo i am trying to use the web component to check if the page is up in the example of the photo i used an ip here from my network and as it is down i wanted it to return the code that would be 400 or 404 or maybe 503 and when it is available return 200 or 201 in the text box as it looks in the photo. The example of the photo I didn’t specify the code I thought it was better to return it as text in the text box so I can see the code being returned. if anyone can help me please

‏‏لقطة الشاشة (40)

The block itself does not tell the problem you’re facing. You need to explain your problem.

Also one thing I noticed is that you used web1.gotFile event which is unnecessary if your server don’t return a file or you requested for it.

Try the Screen.ErrorOccurred event
Taifun

in this case now I tried to change some things and I used a link and it worked, it responds with the code 200, but when I put my ip page, as shown in the image I had sent, it shows that the URL is invalid, something from the uncle as notification from kompanion’s own system, would this be normal?

Can you access the ip from a browser?

Yes because it is a local IP of the network

as i am trying to access an ip it shows the error UNABLE TO GET A RESPONSE WITH THE SPECIFIED URL: HTTP://192.168.0.179

https://imagnity.com/tutorials/app-inventor/check-internet-connection-in-app-inventor/

Taifun

when I did it with a youtube or google page it worked but when I try to do it with a local ip page it shows error UNABLE TO GET A RESPONSE WITH THE SPECIFIED URL: HTTP://192.168.0.179

Does the web viewer load your ip?

yes it does

I tried it with the ip turned off, that is, off the air and it working, because it is an ip present in a microcontroller when it is off, oyster error, but when it is on, it returned the code 200, is this normal? That is, is it normal when it is off not to return 400 or 404?

I didn’t get what you mean… But if you mean it is not responding with error 404 when it’s off, it’s not supposed to response 404 when turned off since 404 means not found but the server needs to be on in order to response to anything.

“404 is a response code that returns when you request something to the server but the server don’t have that content, but it needs to be on in order to get the response”

You might want to learn about response codes.

Solved thank you my friend

1 Like