HTTP - HTTP_GET - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HTTP - HTTP_GET (
/showthread.php?tid=424449)
HTTP Function -
Konstantinos - 22.03.2013
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?
Re: HTTP - HTTP_GET -
Konstantinos - 23.03.2013
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"
Re: HTTP - HTTP_GET -
Misiur - 23.03.2013
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
Re: HTTP - HTTP_GET -
Konstantinos - 23.03.2013
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!
Re: HTTP - HTTP_GET -
ikkentim - 23.03.2013
Maybe it crashes while handling the response?
Re: HTTP - HTTP_GET -
AndreT - 23.03.2013
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)
Re: HTTP - HTTP_GET -
Konstantinos - 23.03.2013
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?