-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPraxisMapper.lua
More file actions
29 lines (25 loc) · 879 Bytes
/
PraxisMapper.lua
File metadata and controls
29 lines (25 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--helper functions for calling PraxisMapper server endpoints.
binaryHeaders = {}
binaryHeaders["Content-Type"] = "application/octet-stream"
binaryHeaders["PraxisAuthKey"] = "testingKey"
binaryParams = {
headers = binaryHeaders,
bodyType = "binary"
}
normalHeaders = {}
normalHeaders["PraxisAuthKey"] = "testingKey"
normalParams = {
headers = normalHeaders,
}
imageHeaders = {}
imageHeaders["PraxisAuthKey"] = "testingKey"
imageHeaders["response"] = {filename = ".png", baseDirectory = system.CachesDirectory}
function QueueCall(url, verb, handler, params)
--don't requeue calls that are already in the queue
for i =1, #networkQueue do
if networkQueue[i].url == url and networkQueue[i].verb == verb then
return
end
end
table.insert(networkQueue, { url = url, verb = verb, handlerFunc = handler, params = params})
end