gpt4 book ai didi

ios - 从 edX API 检索数据

转载 作者:搜寻专家 更新时间:2023-11-01 05:41:33 24 4
gpt4 key购买 nike

我正在尝试将 edx 类(class)信息访问到我的 iOS 应用程序中。最好是,我希望用户能够访问他们正在学习的类(class)列表。

当我发出 GET 请求时,我的数据显示为:

{

detail = "Authentication credentials were not provided.";

}

这是我的代码:

import UIKit
import Alamofire

let kEdxResourceURL = "http://mobile3.m.sandbox.edx.org/"

class ViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

Alamofire.request(.GET, kEdxResourceURL + "api/mobile/v0.5/users/wedu/course_enrollments/").responseJSON() {
(_, _, data, _) in
println(data!)
}
}
}

最佳答案

即使移动 v0.5 已弃用,让我从 Open edX API 开发指南中复制它。

EdX API Authentication OAuth 2.0 The edX Platform APIs use OAuth 2.0 for authentication. OAuth 2.0 is an open standard used by many systems that require secure user authentication. See the OAuth 2.0 Standard for more information. Registering with Your Open edX Instance

To use the edX Platform API with courses on your instance of Open edX, you must register your application with the Open edX server. See the OAuth 2.0 specification for details.

http://edx.readthedocs.io/projects/edx-platform-api/en/latest/authentication.html

关于ios - 从 edX API 检索数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29484537/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com