我想为Windows Phone数据库构建一个基于数据文件的数据库,并使用它来存储以下类的对象。
import unirest
# consume async post request
def consumePOSTRequestSync():
params = {'test1':'param1','test2':'param2'}
# we need to pass a dummy variable which is open method
# actually unirest does not provide variable to shift between
# application-x-www-form-urlencoded and
# multipart/form-data
params['dummy'] = open('dummy.txt', 'r')
url = 'http://httpbin.org/post'
headers = {"Accept": "application/json"}
# call get service with headers and params
response = unirest.post(url, headers = headers,params = params)
print "code:"+ str(response.code)
print "******************"
print "headers:"+ str(response.headers)
print "******************"
print "body:"+ str(response.body)
print "******************"
print "raw_body:"+ str(response.raw_body)
# post sync request multipart/form-data
consumePOSTRequestSync()
答案 0 :(得分:0)
答案 1 :(得分:0)
我想你可能会尝试使用codefirst创建一个数据库... Codefirst是一种从代码创建数据库的新方法,但您需要先创建一个datacontext。 有关使用sql ce https://code.msdn.microsoft.com/windowsapps/Database-in-Windows-Phone-7-d69c13c9/sourcecode?fileId=65025&pathId=2036637683
的Windows Phone 7,请参阅此示例