Tag: alamofire

Swift TRON内容类型HeaderBuilder语法

我正在使用TRON来访问基于ruby on rails的api,我觉得我的问题是因为标题没有正确的信息。 我一直在使用TRON的HeaderBuilder语法,但却无法真正看到语法需要的内容。 我的rails错误是在尝试从特定控制器操作获取数据时 [active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (0.25ms) Filter chain halted as :ensure_valid_accept_media_type rendered or redirected Completed 406 Not Acceptable in 61ms (Views: 30.0ms | ActiveRecord: 2.7ms | Solr: 0.0ms) 在xcode中,我使用rest类型控制器来获取json public class DataController { static let tron = TRON(baseURL: GlobalVariables().baseURL) class Fetched: JSONDecodable { let response: JSON required init(json: JSON) throws […]