今天在测试netty http接口时发现,如果使用urslib2发送请求不会有kepp-alive效果。
测试代码
import urllib2
print urllib2.urlopen("http://localhost:8989/blogQueryService/toDate?param1=1360812238.0")
from urllib2 import Http
h = Http()
headers = {'Connection':'keep-alive'}
h.request('http://localhost:8989/blogQueryService/toDate?param1=1360812238.0','GET',None,headers=headers)