SA-MP Forums Archive
HTTP data retrieving issue - 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 data retrieving issue (/showthread.php?tid=540748)



HTTP data retrieving issue - ranme15 - 06.10.2014

Hello,

I am trying to get data from my website using HTTP_GET, and its just doesn't retrieve any data (it does on internet, a link below).

PHP код:
HTTP(playeridHTTP_GET"r-scripting.sytes.net/curl.php?limit=16&linkid=http://www.*******.com/results?search_query=x?factor""""My*******HttpResponse"); 
PHP код:
public My*******HttpResponse(indexresponse_codedata[])
{
    if(
response_code == 200)
    {
                new 
string[64];
                
format(string64"data retrieved: %s"data);
                
SendClientMessage(index, -1string);
    }
    return 
1;

Output:
Код:
data retrieved:
Link: CLICK HERE

By the way, I am using linux, and on other websites it does retrieving the data.


Re: HTTP data retrieving issue - Chenko - 06.10.2014

Print the response code at the top of the callback and see what kind of response you are getting. Then you can use that to see what the issue is


Re: HTTP data retrieving issue - ranme15 - 06.10.2014

Quote:
Originally Posted by Chenko
Посмотреть сообщение
Print the response code at the top of the callback and see what kind of response you are getting. Then you can use that to see what the issue is
200..


Re: HTTP data retrieving issue - Eth - 06.10.2014

try to increase the string
pawn Код:
new string[200];
format(string, 200, "data retrieved: %s", data);



Re: HTTP data retrieving issue - ranme15 - 06.10.2014

Quote:
Originally Posted by Eth
Посмотреть сообщение
try to increase the string
pawn Код:
new string[200];
format(string, 200, "data retrieved: %s", data);
Even if it hasn't enough cells it would've print some characters. Doesn't work.


Re: HTTP data retrieving issue - Vince - 07.10.2014

The HTTP function doesn't act like a normal browser. In fact, I tried to access that link through wget on Linux and it came up empty with "No results found".

Try using the "data" parameter of the function. Move everything after the first question mark to the data parameter and delete the question mark itself.