LZDigital Posted December 3, 2017 Posted December 3, 2017 I am working on an app that requests information from an API. The response is a JSON file which is then decoded. On my Dev forum and Live Forum, the cURL request is made without a hitch. I generate the URL needed, pass it on to \IPS\Http\URL, and it pulls whatever number of users I ask it to get. Now, I installed it for someone to test how it was going to work, and everything ran smoothly. Installation ran and everything was fine. The cURL request goes through, but the information on the JSON is incorrect. If I'm asking for multiple users in the URL, it only shows me one user. I checked at the URL generated, and it is correct. My question is that if the first 2 servers are getting the correct JSON and the third server isn't, is it a problem on that particular server in terms of curl requests, or is a problem with the API I'm using?
CodingJungle Posted December 3, 2017 Posted December 3, 2017 i would say it is more than likely the third server. it wouldn't happen to be a windows server would it? you might want to check that it actually has curl enabled, IPS will default to sockets if curl isn't install or too low of a version.
LZDigital Posted December 3, 2017 Author Posted December 3, 2017 I'm pretty sure it's running Linux, and curl does seem to be enabled. What would be considered to old? In comparison with cURL versions, mine have 7.55, 3rd one has 7.21.
CodingJungle Posted December 3, 2017 Posted December 3, 2017 I believe IPS requires a min. curl version of 7.36, you can tell IPS to use an older version of curl tho. create a constants.php in the root directory (where index.php is) and/or edit an existing one, and add this to it: define( 'FORCE_CURL', true);
LZDigital Posted December 3, 2017 Author Posted December 3, 2017 Ok I will try that, thank you very much.
bfarber Posted December 4, 2017 Posted December 4, 2017 The response should not depend on which library requested it ... whether cURL or sockets are used behind the scenes shouldn't affect the response you are getting. I would be interested in debugging both requests to see what the difference is. Or if you can send me details about fetching from the API and what wasn't working I can always test from my end here.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.