Tag: 咖啡摩卡

如何使用数据编写摩卡咖啡发布请求testing以testing响应是否匹配?

问题:我如何在摩卡咖啡中写一个post请求testing来testing响应是否匹配? 响应只是一个urlstring,因为它是第三方服务的redirect。 工作示例有效载荷: curl -H "Content-Type: application/json" -X POST -d '{"participant":{"nuid":"98ASDF988SDF89SDF89989SDF9898"}}' http://localhost:9000/api/members member.controller.js // post方法 // Creates a new member in the DB. exports.create = function(req, res) { Member.findByIdAndUpdate(req.body.participant.nuid, { "$setOnInsert": { "_id": req.body.participant.nuid } }, { "upsert": true }, function(err,doc) { if (err) throw err; res.send({ 'redirectUrl': req.protocol + '://' + req.get('host') + '/registration/' […]