-
Doing the following, I would expect that the number could be implicitly converted to a string, however instead a type error exception
My use-case is an API which accepts values in base64
I haven't done comprehensive tests but I worry I'll need to do this any time I take a string value from JSON being sent to my server, just incase the input includes purely numeric characters and their client is loosely typed and sometimes implicitly casts it to integer. Any help or info would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you don't know the types of the values coming in, then you do need to check the types, as you've written. If you're going to do this a lot, create a helper function for this.
|
Beta Was this translation helpful? Give feedback.
If you don't know the types of the values coming in, then you do need to check the types, as you've written. If you're going to do this a lot, create a helper function for this.