You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When call method update_device_token(deviceId), it return
Traceback (most recent call last):
File "/home/samsung/guojia/ArtikAutoTest/ArtikCloudSDK/CloudSDK.py", line 121, in <module>
deviceToken = d.updateDeviceToken(deviceid)
File "/home/samsung/guojia/ArtikAutoTest/ArtikCloudSDK/CloudSDK.py", line 110, in updateDeviceToken
api_response = api_instance.update_device_token(ddid)
File "build/bdist.linux-x86_64/egg/artikcloud/apis/devices_api.py", line 813, in update_device_token
File "build/bdist.linux-x86_64/egg/artikcloud/apis/devices_api.py", line 891, in update_device_token_with_http_info
File "build/bdist.linux-x86_64/egg/artikcloud/api_client.py", line 334, in call_api
File "build/bdist.linux-x86_64/egg/artikcloud/api_client.py", line 157, in __call_api
File "build/bdist.linux-x86_64/egg/artikcloud/api_client.py", line 376, in request
File "build/bdist.linux-x86_64/egg/artikcloud/rest.py", line 224, in PUT
File "build/bdist.linux-x86_64/egg/artikcloud/rest.py", line 174, in request
UnboundLocalError: local variable 'r' referenced before assignment
I found in file devices_api.py update_device_token_with_http_info() method, the header is defined as 'text/plain', it shoud be "application/json" right?
@crazygj thank you providing the error stacktrace. This will be resolved in our next release.
Background:
Requires an upstream fix to our swagger definition which incorrectly marks endpoint as consuming a body and sets wrong content-type. Note that PUT /devices/:deviceId/tokens should only require a path parameter (ie: deviceId). This should be "None".
This will apply a downstream fix into our SDK during next build where "None" content-type will default to "application/json" implicitly in subsequent build/release:
— lines 137
Details of error:
rest.py — No control handling for content-type "text/plain" for http method "PUT" (rest.py). This fails to initialize a variable "r" that is used by the generated code.
— lines 137-169
For me Its working now after replacing select_header_content_type(['text/plain']) with select_header_content_type(['application/x-www-form-urlencoded']) in file devices_api.py > [update_device_token_with_http_info()] > [# HTTP header Content-Type] at line number ~864.
Just curious to know if doing this is safe for now or what challenges or issues I might face later?
When call method update_device_token(deviceId), it return
I found in file devices_api.py update_device_token_with_http_info() method, the header is defined as 'text/plain', it shoud be "application/json" right?
The text was updated successfully, but these errors were encountered: