HTTP - HTTP_GET
#1

I found a good site for getting data about Domain, Country, City but I cannot make it works. It crashes the server when it is trying to retrieve data.

Site: http://www.netip.de/search?query=x.x.x.x

pawn Код:
[debug] Server crashed due to an unknown error
[13:02:01] [debug] System backtrace:
[13:02:01] [debug] #0 50595443 in ?? () from D:\[0.3x] SA-MP Server\samp-server.exe
I tried another one site and it works fine, but it has no Domain that I want to.
Can someone help me with this?
Reply
#2

I still need some help with HTTP function. It keeps crashing the server if I use this query
pawn Код:
"www.netip.de/search?query=my_ip"
Reply
#3

Well, this is weird, but remove "www." and there won't be a crash

#e: wait, it actually returns 301 header, pointing at address with "www.". No idea what happens
Reply
#4

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Well, this is weird, but remove "www." and there won't be a crash

#e: wait, it actually returns 301 header, pointing at address with "www.". No idea what happens
I know, I tried it yesterday without "www." and it printed these:
pawn Код:
[13:15:28] The URL replied: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.netip.de/search?query=my_ip_here">here</a>.</p>
</body></html>

[13:15:28]  HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
I never used that function before and I don't know why it does that. Does anybody know something more about it? It'll help me a lot!
Reply
#5

Maybe it crashes while handling the response?
Reply
#6

A common pitfall here is attempting to print the resulting data if the buffer is larger than 1024 bytes. I've seen this a few times before. (Although perhaps the crash detection should tell you that)
Reply
#7

Well, I tried from 4 different websites which is possible to get the hostname by IP Adresses but all of them do the same.

Quote:
Originally Posted by AndreT
Посмотреть сообщение
A common pitfall here is attempting to print the resulting data if the buffer is larger than 1024 bytes. I've seen this a few times before. (Although perhaps the crash detection should tell you that)
No. By crashdetect:
pawn Код:
// server_log.txt
[debug] Server crashed due to an unknown error
crashinfo.txt file is empty. I also tried with HTTP_POST but the string was "(null)".

I just want to get the information about hostname, already did with the country and it works fine.

Is there any other way?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)