Ingestion Service: Post JPG

This EI doc describes how to construct a request using cURL.

What does the construction look like for Python?

How does the following need to be modified?

res = requests.post(url='https://ingestion.edgeimpulse.com/api/training/data',
                        data='mark.jpg',
                        headers={
								'x-api-key':   'ei_...',                            
								'x-file-name': 'mark.jpg',
								'x-label':     'mark', })
1 Like

@norik.badalyan

The cURL example in the link I provided uses the

  • api/training/data endpoint not the
  • api/training/files endpoint.

So is there example code in Python using the api/training/data endpoint?

I guess more specifically how do I convert the cURL syntax

-F attachments[]="@metadata.json;type=application/json" \
-F attachments[]="@mark.jpg;type=image/jpeg"

into an argument compatiable with the Python requests.post()?