Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

Mockaroo data set upload API problem

$
0
0

I found the solution.
Instead of (using python requests library)
files = {‘file’: open(file_path, ‘rb’)}
response = requests.post(url, headers=headers, files=files)

I need to use the following where it reads the data first vs referencing it as a file.

with open(file_path, 'rb') as f:
    file_content = f.read()       
response = requests.post(url, headers=headers, data=file_content)

Viewing all articles
Browse latest Browse all 2665

Trending Articles