OGeek|极客世界-中国程序员成长平台

标题: ios - Desire2Learn:如何将文件附加到讨论中的新帖子? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 10:03
标题: ios - Desire2Learn:如何将文件附加到讨论中的新帖子?

我可以使用以下提要在讨论中创建新帖子

Feed: host/d2l/api/le/(D2LVERSION: version)/(D2LID: orgUnitId)/discussions/forums/(D2LID: forumId)/topics/(D2LID: topicId)/posts/
Content-Type:"application/json"
http-MetohdOST

 http-body:{
    "arentPostId": null,
    "Subject": "IOS  Testing",
    "Message": {"Content": "ios Test meassage","Type": "Text"},
    "IsAnonymous": "false"
 }

我怎样才能附上这个文件?



Best Answer-推荐答案


API 不提供将文件上传到现有讨论帖的方法。创建后,您可以only update the post's Subject and Message components .

要创建带有附件的新讨论帖,请发送多部分帖子正文。正文中的 first 部分 should be your post's data就像你的例子一样。后续部分可以包含 file data for one or more attachments并且应该遵循 RFC2388 多部分混合方法(因为第一部分是 JSON 数据,后续部分是二进制数据)。

关于ios - Desire2Learn:如何将文件附加到讨论中的新帖子?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15812157/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4