Attach a file using post API to erpnext Doc

I want to attach a file to spesific doctype in erpnext using rest API .
how can i do that? i can insert data using rest api but I dont know how to insert a file.
here example code for insert the data.

1 Like