I have an application that interfaces to a custom REST server. The application can GET, POST, PUT, and DELETE fine on Android. On MacOS, iOS, GETs are working fine and POST and PUT without a body work fine, but when i try a PUT with json.encode table in the params, the data does not make it through the server.
\_userInfo.profile = deepcopy(userProfile) \_userInfo.segments = deepcopy(userSegments) \_userInfo.deviceIds = deepcopy(userDeviceIds) \_userInfo.deviceModels = deepcopy(userDeviceModels) print('mbapi:saveUser '..userid) print('userInfo:: '..json.encode(\_userInfo)) local url = \_url['user']..'/'..userid network.request(url, "PUT", function(e) if e.isError then end end, netReqParams(jwt,\_userInfo,\_userInfo) )
where netReqParams is
local function netReqParams(jwt,data,body) -- WINDOWS ANDROID SIMULATOR - OK -- ANDROID DEVICE - OK -- MAC EMULATOR - -- MAC SIMULATOR - -- IOS DEVICE - local params = {} local headers = {} headers["Content-Type"] = "application/json"--; charset=utf-8" headers["Authorization"] = jwt params.headers = headers if data ~= {} then params.data = json.encode(data) end if body ~= {} then params.body = json.encode(body) end params.timeout = 0.010 return params end
any thoughts on why this works with Windows and Android, but not MacOS and iOS. The server is HTTPS with TLS1.2.