TDResources WebClient KeyError

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

Hi @olegchomp,

thanks for the report, we are having a look at it.
What build are you using?


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)

Hey @alphamoonbase,

yup, the request id is currently deleted upon the first response so redirects create this error as this is not handled in the TDResources.



this will be fixed in the next 2023.10k release.