Ahoj, mam dotaz. Upravuju Conyx
[CONYX | SONYX | SPTFJ | NBTERM]na nove api. A ted jsem se dostal k souborum. Minule to byl ocistec. Ted je to ocitec.
Mam nasledujici form data:
--DiZiZbndrY^M
Content-Disposition: form-data; name="file";^M
Content-Type: text/plain^M
^M
123
--DiZiZbndrY^M
Content-Disposition: form-data; name="file_type"^M
^M
text/plain^M
--DiZiZbndrY^M
Content-Disposition: form-data; name="id_specific"^M
^M
23330^M
--DiZiZbndrY--
a ty posilam takto
body=get_mpart() # viz vyse
url="https://nyx.cz/api/file/upload"
#dat=urllib.parse.urlencode(body.('utf8'))
req = urllib.request.Request(url,data=body,method='PUT')
req.add_header('content-type' , 'multipart/form-data; boundary="' + boundary + '"')
req.add_header('content-length' , str(len(body)))
req.add_header('Authorization', 'Bearer ' + get_auth_token())
resp = request.urlopen(req).read()
Neustale mi Nyx vraci 422 unprocessable entry
Nevidite nekde, co by mohlo byt spatne?
Moc dekuji