HTTP request
#1

Hello,
I try to improve my FS for online radio. I needed to make HTTP request to URLs of radios. I tried to get request from working radio and broken radio. But I always get only response "1". Please, tell me. Is it real to make request, or HTTP system for SA-MP isn't so improved?
Reply
#2

Show us the code you've made so far.
Reply
#3

Ok, I'll tell with more information...
Is it really to get response code for avaliable streaming over HTTP?
Example:
PHP Code:
#include <a_samp>
#include <a_http>
forward Check(indexresponse_codedata[]);
public 
OnFilterScriptInit()
{
    
HTTP(-1,HTTP_GET,"http://ice.somafm.com/xmasinfrisko","","Check");
    
HTTP(-1,HTTP_GET,"http://78.159.104.167:80","","Check");
    return 
1;
}
public 
Check(indexresponse_codedata[]) return printf("Index - %d, response code - %d, data - %s",index,response_code,data); 
First radio doesn't work. Response code - 1. But in Winamp (and others media players) response code is 404.
Second radio works. But response code is 1 too.
If change HTTP_GET to HTTP_HEAD response code will be 1 too...
How to be?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)