Yes, it should be a lot easier, probably a bit overwhelmed with many other things :-)
GET /t HTTP/1.1
Host: precisepangolinserver:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: _atshc={}; __atuvc=7%7C32%2C5%7C33%2C0%7C34%2C4%7C35%2C73%7C36
Request of GET /users:
GET /users HTTP/1.1
Host: precisepangolinserver:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: _atshc={}; __atuvc=7%7C32%2C5%7C33%2C0%7C34%2C4%7C35%2C73%7C36
??B%ME~?@@?:
?7
?7????4(????????
2?8??uHTTP/1.1 200 OK
Server: ngx_openresty/1.4.2.9
Date: Fri, 18 Oct 2013 00:29:28 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
193
[{"id":45,"firstname":"Biggirl","lastname":"Subroto Mangkuwanitoudo","age":"2 "},{"id":42,"firstname":"Michael","lastname":"Rijanto R","age":"99 "},{"id":77,"firstname":"Nur","lastname":"wely","age":"52 "},{"id":44,"firstname":"Orin","lastname":"Setyadi","age":"13 "},{"id":85,"firstname":"Update test","lastname":"test","age":"99 "},{"id":86,"firstname":"test202","lastname":"test","age":"2 "}]
0
BBB%ME4c?@@S,
?7
?7????????4*Ѐ??f
8???2??`R!|??B%ME???@@??
?7
?7????????4*Ѐ??V/
8???2?GET /users HTTP/1.1
Host: precisepangolinserver:8080
Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36
Accept: */*
Referer: http://precisepangolinserver:8080/users
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: _atshc={}; __atuvc=7%7C32%2C5%7C33%2C0%7C34%2C4%7C35%2C73%7C36
Request of POST:
POST /users HTTP/1.1
Host: precisepangolinserver:8080
Connection: keep-alive
Content-Length: 55
Accept: application/json, text/_javascript_, */*; q=0.01
Origin: http://precisepangolinserver:8080
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36
Content-Type: application/json
Referer: http://precisepangolinserver:8080/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: _atshc={}; __atuvc=7%7C32%2C5%7C33%2C0%7C34%2C4%7C35%2C73%7C36
{"firstname":"Precise","lastname":"Pangolin","age":"1"}E?`R?BB%ME4)?@@?A
?7
?7???9??b?????|??
??8??bE?`R?00B%ME")?@@?R
?7
?7???9??b?????|??
??8??b
It seemed I am having problem with cjson. I believe it should be included in openresty as default. But it throws error 500. Then tried with just json, and it went straight to error 400.
I plan to sift the tutorial as you suggested on the weekend. Thanks for the link.