comparison examples/blog/src/lib/test.luan @ 1152:21d157b153fe

change http parameters interface
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 04 Feb 2018 19:25:12 -0700
parents c38f6619feb9
children a50803fde972
comparison
equal deleted inserted replaced
1151:dbb3cb906482 1152:21d157b153fe
30 init() 30 init()
31 print '/new' 31 print '/new'
32 get_page '/new' 32 get_page '/new'
33 33
34 init() 34 init()
35 Http.request.parameter.subject = 'test' 35 Http.request.parameters.subject = 'test'
36 Http.request.parameter.content = 'this is a test' 36 Http.request.parameters.content = 'this is a test'
37 Http.request.parameter.save = 'whatever' 37 Http.request.parameters.save = 'whatever'
38 print '/new submit' 38 print '/new submit'
39 get_page '/new' 39 get_page '/new'
40 local posts = Post.get_all() 40 local posts = Post.get_all()
41 #posts == 1 or error() 41 #posts == 1 or error()
42 local post_id = to_string(posts[1].id) 42 local post_id = to_string(posts[1].id)
43 43
44 init() 44 init()
45 Http.request.parameter.post = post_id 45 Http.request.parameters.post = post_id
46 print '/edit' 46 print '/edit'
47 get_page '/edit' 47 get_page '/edit'
48 48
49 init() 49 init()
50 Http.request.parameter.post = post_id 50 Http.request.parameters.post = post_id
51 Http.request.parameter.subject = 'test' 51 Http.request.parameters.subject = 'test'
52 Http.request.parameter.content = 'this is an edit' 52 Http.request.parameters.content = 'this is an edit'
53 Http.request.parameter.save = 'whatever' 53 Http.request.parameters.save = 'whatever'
54 print '/edit submit' 54 print '/edit submit'
55 get_page '/edit' 55 get_page '/edit'
56 56
57 init() 57 init()
58 print '/ again' 58 print '/ again'