The .csv mock files have to be written as StringIO objects. But, to send it as POST request, they have to be in BytesIO objects. Then, how exactly?
So, after making them into StringIO object you have to read() and decode() it and pass it as __init__ parameter of BytesIO class.
After making them into BytesIO objects, it has to be saved as a dictionary with this format:
then, the object has to be sent as 'multipart/form-data' content_type. This is how:
So basically that's how. See you on the next occasion!
0 komentar:
Post a Comment