In the test, I have to pass the image and video to the request, for this I first convert it to an array of numbers and then pass it using “http. file”.
An error occurred while executing the request: IdentityHandler: something wrong with user image file
I think you need the 'b' parameter when calling open, not http.file where the 2nd argument represents the filename. Without the 'b' parameter, the image variable will be a string representation of the binary data (likely UTF-8 but not 100% sure on that). It could be that subsequently converting this string representation into a FileData object that the data becomes corrupted.
I’ll mention that native JSON doesn’t support binary data, and so what typically happens is binary data are encoded using base64, which is very different from what you’d be uploading in this way. Do you know what the server is expecting (do you have a recording to compare against)?
I expect a response from server 200.
All my tests are saved in json format and I wrote one script for them. To pass the image and video in the tests, I first transform them into an array of numbers. Then I pass the resulting array of numbers to the test and run the script. And when I run it, I get an error that something is wrong with the image, I assume they are damaged.
Could you tell me how best to implement this?