Webservice document says:
POST .../classes/Building/cards/64/attachments HTTP/1.1
[various headers]
Content-Type : multipart/form-data
== Part, name : "attachment", content-type : "application/json" ==
{
_description : this is a test,
_category : Image,
}
====
== Part, name : "file", content-type : "*/*" == binary
====
I'm testing with python, tested create card, relation. But I don't understand how to upload of an attachment. What does == Part, name : "attachment", content-type : "application/json" == and Part, name : "file", content-type : "*/*" == binary parts mean.
Let's say I have attachment upload part in my Python script:
cmdbuild_url = "..../classes/Servers/cards/64/attachments"
data = {'_description': 'this is a test', '_category': 'Image'}
headers = {'Content-type': 'multipart/form-data', 'Accept': '*/*', 'CMDBuild-Authorization': sessionid, 'data': 'data'}
request = requests.post(cmdbuild_url, data=json.dumps(data), headers=headers)
How I define file wich I want to upload?