Karoffe Posted January 23, 2015 Share Posted January 23, 2015 I have 2 questions First one can I connect to a URL which should return a xml file(or a string and I create the XML file myself) ? something like this function testFunction(result) outputChatBox(result) end setTimer(function() local test = callRemote ( "https://yts.re/api/upcoming.xml", testFunction) if not test then outputChatBox("failed") else outputChatBox("succeed") end end, 2000, 1) the URL which I want to connect is this https://yts.re/api/upcoming.xml ^ That's just an example.. If I used callRemote on this URL what should return instead of "ERROR" ? And how to make it return an XML file or a string and I create the XML file myself ? 2nd Question Is there a way in LUA to connect to API of websites (without the callRemote) ? I am going to use this outside MTA so I need to find a way. Link to comment
WASSIm. Posted January 23, 2015 Share Posted January 23, 2015 use fetchRemote to download file Link to comment
Karoffe Posted January 23, 2015 Author Share Posted January 23, 2015 That also returns error Link to comment
3B00DG4MER Posted January 23, 2015 Share Posted January 23, 2015 fetchRemote to download file and then you've to get local client file URL if in server then same just get local url where's the file going to download Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now