how to create twitter style API url.. |
[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
[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/15...15/#768040
[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/15...15/#768040[/quote] Thanks WanWizard for correction.. |
Welcome Guest, Not a member yet? Register Sign In |