Scotty2024 Posted November 3, 2013 Share Posted November 3, 2013 Does anyone know how to use Google Flight RPC or how to post a json array to it? The only documentation I've found for it is here. It shows the responses and part of the requests. I'm not sure how to build and post a json array using PHP. Any ideas or examples how? Quote Link to comment Share on other sites More sharing options...
Scotty2024 Posted November 8, 2013 Author Share Posted November 8, 2013 Bump Quote Link to comment Share on other sites More sharing options...
kicken Posted November 8, 2013 Share Posted November 8, 2013 Use json_encode to create a JSON string from a PHP array. Use json_decode to decode to json response back into a PHP array. Use curl to handle the HTTP request. Quote Link to comment Share on other sites More sharing options...
Scotty2024 Posted November 9, 2013 Author Share Posted November 9, 2013 Could you please show me an example? For example, in the documentations first part, how would you encode the following into a json array? [,[[,"fs","[,[,[\"SJC\"]\n,\"2012-04-05\",[\"EWR\",\"JFK\",\"LGA\"]\n,\"2012-04-12\"]\n]\n"]],[,[[,"b_ca","54"],[,"f_ut","search;f=SJC;t=EWR,JFK,LGA;d=2012-04-05;r=2012-04-12"],[,"b_lr","11:36"],[,"b_lr","1:1528"],[,"b_lr","2:1827"],[,"b_qu","3"],[,"b_qc","1"]]]] What would the cURL look like with the necessary headers? Thanks. Quote Link to comment Share on other sites More sharing options...
Scotty2024 Posted November 11, 2013 Author Share Posted November 11, 2013 Bump again. Sorry I don't know how to put the above into a json array or set up the curl headers. Quote Link to comment Share on other sites More sharing options...
nbarbieri Posted February 19, 2014 Share Posted February 19, 2014 Hi! I'm having the same issue, does anyone has got an answer on it?! Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.