WhoAmI Posted May 6, 2015 Share Posted May 6, 2015 Hello. I'm trying to get data from .json page local loadCountries = function ( ) callRemote ( "http://country.io/names.json", loadCountriesCallback ); end But the problem is that debug says that argument 2 should be string, but i'm not providing host but URL... WARNING: [jacob]/country/country_s.lua:25: Bad argument @ 'callRemote' [Expected string at argument 2, got nil] Link to comment
MTA Team botder Posted May 6, 2015 MTA Team Share Posted May 6, 2015 loadCountriesCallback is nil (not even a function). Link to comment
WhoAmI Posted May 6, 2015 Author Share Posted May 6, 2015 Oh thanks, i had to put 'loadCountriesCallback' function before 'loadCountries'. Damn! Link to comment
WhoAmI Posted May 6, 2015 Author Share Posted May 6, 2015 Getting error 405, which means A request was made of a resource using a request method not supported by that resource; for example, using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource. How can I get this JSON array into my script? Link to comment
Walid Posted May 6, 2015 Share Posted May 6, 2015 Getting error 405, which means A request was made of a resource using a request method not supported by that resource; for example, using GET on a form which requires data to be presented via POST, or using PUT on a read-only resource. How can I get this JSON array into my script? Bro did you create the call back function. Link to comment
WhoAmI Posted May 6, 2015 Author Share Posted May 6, 2015 C'mon man, without callback function I wouldn't know what the error is, mr. Brain. Link to comment
Walid Posted May 6, 2015 Share Posted May 6, 2015 C'mon man, without callback function I wouldn't know what the error is, mr. Brain. My bad i didn't see this "Getting error 405, which means" Mr. einstein. Link to comment
Scripting Moderators Sarrum Posted May 7, 2015 Scripting Moderators Share Posted May 7, 2015 Use fetchRemote. 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