Getting started with K6 was easy. But, now facing some difficulties porting Python code to K6.
Python code - START
# Imports
import base64
from zipfile import ZipFile
from io import BytesIO
# Extract Zip
def extract_zip(self, input_zip):
input_zip = ZipFile(BytesIO(input_zip))
for name in input_zip.namelist():
if name.endswith(".json"):
return input_zip.read(name)
# Code snippet
base64_data = USER_INPUT_DATA
data_b4_utf8_decode = self.extract_zip(base64.b64decode(base64_data))
data = data_b4_utf8_decode.decode('utf-8')
Python code - END
Above is a snippet of Python code. I was able to get the K6 equivalent for b64decode (encoding.b64decode()). But, how will the rest of the code be realized in K6?
Thanks,
Melvin