Closed Memory-9527 closed 1 year ago
正好在重构这个脚本。你可以试下这段代码
let sdk = require('postman-collection'),
newRequest = new sdk.Request(pm.request.toJSON()),
resolvedRequest = newRequest.toObjectResolved(null, [pm.variables.toObject()], { ignoreOwnVariables: true }),
url = new sdk.Url(resolvedRequest.url),
canonicalUrl = url.getPathWithQuery()
let method = request.method
var body = ""
if (method == 'POST' || method == 'PUT' || method == 'PATCH') {
body = resolvedRequest.body.raw;
}
你也可以试试 APIv3 Public Workspace,欢迎反馈。⚠️ workspace 的路径更改,请使用新链接。
PS:证书密钥在 Environment 中设置,不在脚本中设置了。
好的,我研究下,有问题我继续反馈