0
헤더에 다른 키 - 값 쌍이있는 키가있는 Alamofire 4 요청의 헤더를 설정하려고합니다. 신속한 컴파일러는 헤더 변수에 만족하지만 Alamofire는이를 사용하지 않습니다.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
}
이 항목을 확인하십시오. http://stackoverflow.com/questions/41294012/alamofire-post-request-with-nested-json-parameters –
@SivajeeBattina 그 종류는 제 3 자 lib' SwiftyJson'. – BlueBoy
예. SwiftyJSon을 사용하고 싶지 않으십니까? –