root/lang/lua/webservice-simplua/example/flickr_echo.lua @ 9086

Revision 9086, 324 bytes (checked in by mattn, 6 years ago)

lang/lua/webservice-simplua,
lang/lua/webservice-simplua/example,
lang/lua/webservice-simplua/example/flickr_echo.lua,
lang/lua/webservice-simplua/webservice,
lang/lua/webservice-simplua/webservice.lua:
added webservice-simplua like a 'WebService::Simple'.

Line 
1local webservice = require('webservice')
2
3local api = webservice.simplua.new({
4        base_url = 'http://api.flickr.com/services/rest',
5        params = {
6                api_key = 'your_api_key'
7        }
8})
9
10local ret  = api.get({
11        method = 'flickr.test.echo',
12        name = 'value'
13})
14
15local dom = ret.parse_xml()
16print(dom:select("name")[1]:text()) -- "value"
Note: See TracBrowser for help on using the browser.