ios - Desire2Learn:如何将文件附加到讨论中的新帖子?
<p><p>我可以使用以下提要在讨论中创建新帖子</p>
<pre><code>Feed: host/d2l/api/le/(D2LVERSION: version)/(D2LID: orgUnitId)/discussions/forums/(D2LID: forumId)/topics/(D2LID: topicId)/posts/
Content-Type:"application/json"
http-Metohd:POST
http-body:{
"ParentPostId": null,
"Subject": "IOSTesting",
"Message": {"Content": "ios Test meassage","Type": "Text"},
"IsAnonymous": "false"
}
</code></pre>
<p>我怎样才能附上这个文件?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>API 不提供将文件上传到现有讨论帖的方法。创建后,您可以<a href="http://docs.valence.desire2learn.com/res/discuss.html#Discussions.UpdatePostData" rel="noreferrer noopener nofollow">only update the post's Subject and Message components</a> .</p>
<p>要创建带有附件的新讨论帖,请发送多部分帖子正文。正文中的 <em>first</em> 部分 <a href="http://docs.valence.desire2learn.com/res/discuss.html#Discussions.CreatePostData" rel="noreferrer noopener nofollow">should be your post's data</a>就像你的例子一样。后续部分可以包含 <a href="http://docs.valence.desire2learn.com/basic/fileupload.html#simple-uploads" rel="noreferrer noopener nofollow">file data for one or more attachments</a>并且应该遵循 RFC2388 多部分混合方法(因为第一部分是 JSON 数据,后续部分是二进制数据)。</p></p>
<p style="font-size: 20px;">关于ios - Desire2Learn:如何将文件附加到讨论中的新帖子?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/15812157/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/15812157/
</a>
</p>
页:
[1]