我正在尝试在我的请求中设置HTTP标头字段:
var params = [OdooAuth.db, OdooAuth.uid, OdooAuth.password!,"product.pricelist","search_read", [[]],["fields":["id"]] ] as [Any]
let request = AlamofireXMLRPC.request(OdooAuth.host2!, methodName: "execute_kw", parameters: params )
request.request?.addValue("value", forHTTPHeaderField: "HTTP_USER_AGENT")
但是当我写这个时,会发生错误:
Cannot use mutating member on immutable value: 'request' is a get-only property
我使用的是Swift4和this library