![]() |
how to create twitter style API url.. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: how to create twitter style API url.. (/showthread.php?tid=32503) |
how to create twitter style API url.. - El Forum - 07-26-2010 [eluser]Unknown[/eluser] Hello, I want to share how to create Twitter style API url. twitter using API Url like this : Code: http://search.twitter.com/search.json?callback=foo&q=twitter now we create this configuration in application/config.php : Code: $config['uri_protocol'] = "PATH_INFO"; because i only need 1 controller using this, then i create this in my application/route.php Code: // Weather Services then, in my controller as usually, i create function weather and loc like this : Code: function weather($type) { and you can call the url http://your.server.url/weather.json?param and http://your.server.url/loc.json?param that's it.. thanks how to create twitter style API url.. - El Forum - 07-26-2010 [eluser]WanWizard[/eluser] You need a patch that allows you to use segments for URI routing while not destroying the query string. see http://ellislab.com/forums/viewthread/159382/P15/#768040 how to create twitter style API url.. - El Forum - 07-26-2010 [eluser]Unknown[/eluser] [quote author="WanWizard" date="1280149851"]You need a patch that allows you to use segments for URI routing while not destroying the query string. see http://ellislab.com/forums/viewthread/159382/P15/#768040[/quote] Thanks WanWizard for correction.. |