Hi! trying to handle callback from API and get error. Same request through op().request works. Idk it might be related to statusCode 100.
Example request: op.TDResources.WebClient.Request(callback, url, "POST", data=payload_json)
Traceback (most recent call last):
File "/sys/TDResources/webClient/webclient1_callbacks", line 2, in onResponse
File "/sys/TDResources/webClient/WebClientExt", line 74, in onWebResponse
KeyError: 17
@snaut
I am pretty sure they are hitting a 300 or 100 status code which is empty, but has the correct id. In line 75 you are deleting the entry. So when the actual response after the redirect comes in, you have an empty dict and a key-error.
My webclient simply does the following until I have something better to do with the 100 & 300 responses.
if statusCode < 200 and 300 <= statusCode < 400:
self.log("Ignoring Response", statusReason)
return
Hey! With the newest 2023.10k release I’m getting an odd behavior. Could it be related to these recent changes and fixes?
I’m using TDResources.WebClient.Request the same way @olegchomp was using (I’ve derived my code from his basically).
My callbacks through WebClient now return None for status code, headerdict and data. Doing the same call from webclient dat instead of TDResources retrieves the data correctly. I’ve changed nothing, only opened my project with the new version.
Am I misunderstanding something, how do I handle this?