如何使用 Desire2Learn 的 REST API 将文件上传到我的储物柜?服务器返回状态码 200 但“发生意外错误”
POST /d2l/api/le/1.0/locker/mylocker/?x_a={appID}&x_c={appSig}&x_b={myUserID}&x_d={myUserSig}&x_t={time) HTTP/1.1
Host: myHost.com
Accept: */*
Content-type: multipart/mixed;boundary=BOUNDARY
Content-Length: 181
--BOUNDARY
Content-Type: text/plain
Content-Length: 4
test
--BOUNDARY
Content-type: application/json
Content-Length: 36
{"Description":"","IsPublic":"true"}
--BOUNDARY--
编辑(另一个请求,相同的结果)
POST /d2l/api/le/1.0/locker/mylocker/testFile?{authQueryparms}
Host: myHost.com
Accept: */*
Content-type: multipart/mixed;boundary=BOUNDARY
Content-Length: 288
--BOUNDARY
Content-Type: text/plain
Content-Length: 4
test
--BOUNDARY
Content-type: application/json
Content-Length: 142
{ "Description": {"Text": "Text description string for file.", "HTML": "<p>Text description string for <i>file</i>.</p>" }, "IsPublic": true }
--BOUNDARY--