Unity???Flask??????а???
???????????? ???????[ 2015/3/5 16:17:29 ] ??????????????? ??????? ????
????GET???????JSON??????£?
{
"data":
[
{
"id": 0??
"name": "A"??
"score": 100
}??
{
"id": 1??
"name": "B"??
"score": 200
}
]
}
?????????id?????????????????????????????????洦?????????????
????POST????JSON??????£?
????{
????"id": 0??
????"name": "C"??
????"score": 300
????}
??????????????????????index???????
????def index():
????cur = g.db.execute('select id?? name?? score from rank order by score desc;')
????result = cur.fetchmany(100)
????data = []
????for row in result:
????data.append({'id': row[0]?? 'name': row[1]?? 'score': row[2]})
????return jsonify({'data': data})
??????????jsonify??g??flask?????????治?????????????????????flask??????
???????????????????????????????????100?????????????curl??????????????????????create??????
????def create():
????status = {'status': 'OK'}
????if not request.json or not 'name' in request.json or not 'score' in request.json:
????status['status'] = 'bad request'
????try:
????g.db.execute('insert into rank (name?? score) values (??? ?)'?? [request.json['name']?? request.json['score']])
????g.db.commit()
????except:
????status['status'] = 'database error'
????return jsonify(status)
?????????POST??????JSON?????????????request.json??????????args????form???????????????status??????????????????
????????curl???????POST????Σ????????POST?????м????????
????curl -i -X POST -H "Content-Type: application/json" -d '{"id": 0?? "name": "xyz"?? "score": "800"}' 127.0.0.1:5000/scores
????-H???????????????????-d????????Я???????????????????????????????JSON?????
??????????????????????????????????дC#????????
?????????????????????????????????????????UI?????
?????????????????????????????MonoBehaviour?????????????????????Coroutine????????????????????????Unity?????????????з??????????????????????????????£?
private static SaveLoad _instance = null;
public static SaveLoad Instance {
get
{
if (_instance == null)
{
GameObject go = new GameObject("SaveLoadGameObject");
DontDestroyOnLoad(go);
_instance = go.AddComponent<SaveLoad>();
}
return _instance;
}
}
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??????????????????????????????????????web?????????????????????????????????????Щ???棿???APP?????е??????????????????????????????????????????????????Web???????????????????Espresso????????????App??????????????????????????????2??????????????????????????1????????????????????????????δ??????????????????????????????????棩??????????????Hive???????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????