iOS中http标头的自动大写?

时间:2017-09-22 05:59:14

标签: ios swift3 nsurlsession nsurlrequest

如何通过" location" (NSURLRequest或URLSession的HTTP标头中的所有小写字母)?我编码像

let session = URLSession.shared
let request = NSMutableURLRequest(url: url!)
request.httpMethod = "GET"
request.addValue("XYZLocation", forHTTPHeaderField: "location")
request.addValue("XYZLoc", forHTTPHeaderField: "loc")
print("Header : \(String(describing: request.allHTTPHeaderFields))")

始终打印Location: XYZLocation, loc: XYZLoc。我希望location:XYZLocation, loc: XYZLoc。为什么' l'总是在地点获得资本化?

0 个答案:

没有答案