Codeceptjs unirest帮助

时间:2017-12-16 09:47:43

标签: unirest codeceptjs

框架 - codeceptjs。 我想向我的aplication发送api请求:  I.sendPostRequest  I.sendGetRequest 等。

我安装了unirest库。我接下来要做什么?如何为这些函数编写帮助器?

1 个答案:

答案 0 :(得分:1)

Install inirest with: npm install unirest -g

to delete:
await I.sendDeleteRequest(url)

to post:

await I.sendPostRequest(url, null, {
    'Content-Type': 'application/json'
})