我正在尝试设置 Alamofire 4 请求的标头,其中标头具有一个键,其值是另一个键值对。swift 编译器对我的头变量很满意,但 Alamofire 不会接受它们。
这就是我所拥有的:
let subHeader = [
"some-key": "some-value",
"another-oey": "another-value"
]
let headers : [String: Any] = [
"some-header-key": "some-header-value",
"subdata": [subHeader]
]
// Upload data
Alamofire.upload(data,
to: uploadurl,
method: .put,
headers: headers)
.validate()
.response { response in
// Handle response
}