【发布时间】:2016-07-06 06:53:22
【问题描述】:
我在 parse.com 上使用云代码创建了一个项目。
现在我想创建一个 VBScript 来调用 CURL,如下所示。
curl -X POST \
-H "X-Parse-Application-Id: myAppId" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
curl -X POST \
-H "X-Parse-Application-Id: myAppId" \
-H "Content-Type: application/json" \
-d '{}' \
http://localhost:1337/parse/functions/hello
在javascript中我们可以通过以下代码实现。
Parse.initialize('myAppId','unused');
Parse.serverURL = 'https://whatever.herokuapp.com';
var obj = new Parse.Object('GameScore');
obj.set('score',1337);
obj.save().then(function(obj) {
console.log(obj.toJSON());
var query = new Parse.Query('GameScore');
query.get(obj.id).then(function(objAgain) {
console.log(objAgain.toJSON());
}, function(err) {console.log(err); });
}, function(err) { console.log(err); });
如何使用 VBScript 实现 .vbs 文件?
【问题讨论】:
-
这个例子是经典的 ASP,它使用 VBScript 但可以改编 - How can I post data using cURL in asp classic?
标签: curl parse-platform vbscript