def go():
'''restful方式创建namespace'''
ui='http://127.0.0.1:12345/namespaces/jt_2'
head={'Accept':'text/json','Content-Type': 'text/json'}
#r=requests.get(ui)
r=requests.post(ui,json={},headers=head)
print r.status_code
#print r.content
hs=r.headers
print hs
print r.content
def creatTable():
###建表语句
14 ui='http://127.0.0.1:12345/jt_1:sec_table/schema'
15
16 dt='<?xml version="1.0" encoding="UTF-8"?><TableSchema name="users"><ColumnSchema name="family_1" CACHE_DATA_ON_WRITE="TRUE"/><ColumnSchema name="family_2" C ACHE_DATA_ON_WRITE="FALSE"/></TableSchema>'
17 #dt_mp={'TableSchema':{'name':'users','ColumnSchema':[{'name':'family_1'}]}}
18 head={'Accept':'text/xml','Content-Type': 'text/xml'}
19 #head={'Accept':'text/json','Content-Type': 'application/json'}
20 print 'gogog-----'
21 r=requests.post(ui,data=dt,headers=head)
22 #r=requests.post(ui,json=dt_mp,headers=head)
23 print 'end-----'
24 print r.status_code
25 #print r.content
26 hs=r.headers
27 print hs
28 print r.content