URLComponents 在 'path' 部分失败

URLComponents fails on 'path' part

如果 path 更复杂呢?我怎样才能让 URLComponents 正常工作?路径是这样吗?

urlComponents.path = "v3/sandbox115e22c785254f36953c9f28337689bb.mailgun.org/message"

不幸的是,它在这里失败了:

guard let uriString = urlComponents.url?.absoluteString else {
    return request.eventLoop.makeFailedFuture(Abort(.badRequest))
}

URLComponents而言,路径必须以斜线开头

urlComponents.path = "/v3/sandbox115e22c785254f36953c9f28337689bb.mailgun.org/message"