alamofire

Cannot invoke 'append' with an argument list of type '(String, withName: String)' in Alamofire 4.0

霸气de小男生 提交于 2020-02-04 01:35:27
问题 I'm using Alamofire 4.0 to upload video to server after select or record it through device/camera but when I'm trying to call upload function with append , this error appeared to me in all append statement , what is the wrong in my code. the second my question about if I want to display progress with percentage of progress during upload how I can make that through Alamofire. Thanks :) My code after reading url of selected/recorded video func imagePickerController(_ picker:

How to get and save the response in swift5 and Alamofire 5 beta version?

▼魔方 西西 提交于 2020-02-03 10:44:08
问题 I tried some code but still, my issue is not resolved. Please help me i am new in swift code. let parameters: Parameters = ["skey": "XXXXXX","country_code":"91","mobile":"XXX004","user_role":"4"] AF.request("http://chkdin.biz/dev/clinic/api/v1/login_otp?", method: .get, parameters: parameters) .responseJSON { (response) in switch response.result { case .success: if let JSON = response.result.value as? [String: Any] { let status = JSON["status"] as! String print(status) } case .failure(let

How can I post request json body in swift using Alamofire?

狂风中的少年 提交于 2020-01-30 08:08:13
问题 I need to make a POST request in the json body for my app backend but the response returns a failure. I assume my json formatting or encoding is wrong but I can't figure out what the problem is. I have attempted a lot of different solutions but I haven't been able to find one that works. Can anyone see which part of my code is responsible for the failure? let headers: HTTPHeaders = [ "accept": "application/json", "content-type": "application/json", "authorization": self.authValue, "x-iyzi-rnd

Alamofire parameter with multiple values in one Key

南楼画角 提交于 2020-01-26 04:53:22
问题 How to send parameter as alamofire parameter for the following data? data : {"username":"username","password":"password"} I want to achieve following through alamofire paramter, but I failed to achieve this. what I'm doing is: let parameter: Parameters = ["data": ["username": "\(textFieldUserName.text!)", "pass": "\(textFieldPassword.text!)"]] Alamofire.request(loginUrl, method: .post, parameters: parameter,encoding: JSONEncoding.default, headers: nil).responseJSON { response in but it is not

How to set body parameter for Alamofire swift - Parameters Issue

╄→尐↘猪︶ㄣ 提交于 2020-01-26 03:59:26
问题 I am really struggling to set body parameter for posting data to server. I have different json encoding references but its not working. Anybody please suggest. Issue is after passing values into parameter SectionList model gives backslashes and over all parameters not serialized. My values are : AppID ApprovDT UnitId SectionList (Model as I encode it to JSON). Variable Code: let someDate = Date() let approvDT = Int(someDate.millisecondsSince1970) let unitId = id let AppID = UserDefaults

Swift - Block loop from continuing until download operation finishes

余生颓废 提交于 2020-01-26 03:12:22
问题 I am currently trying to download multiple files upon user request for a game. My goal is to have it download only one file at a time and stop executing code until that file has finished downloading. My code is an array of JSON objects, in each contains a path for where to download them to(path) and the URL of the file. I am looping through the array and using AlamoFire to download them with a .downloadProgress closure. Alamofire.download( json["url"].stringValue, method: .get, to:

Errors with Alamafire SDK with XCode 6.3 and iOS 8.3

时光毁灭记忆、已成空白 提交于 2020-01-25 11:03:28
问题 Anyone please let me know what is this all about? I am stuck since a week on this and no help from searching. I posted my query to the developer of Alamofire but still no response. Please help! I am totally confused what is wrong in the integration of Alamofire. I have followed every step and this issue is coming with XCode 6.3 as before it was running properly. When I am adding the Framework under "Copy Frameworks", it is adding the Framework twice showing different paths but when I am Going

Alamofire Request call with: Parameters, Headers and Body not working

依然范特西╮ 提交于 2020-01-25 06:57:27
问题 I have two questions with regards to the Alamofire code below. My JSON fails if I remove the ?action=heartbeat at the end of the URL even though I have action = heartbeat in the parameters, why? How do I add my JSON data/body in the AF.request code below? let urlString = "https://intelipos.dynalias.net/ioc/rest.asp?action=heartbeat" let parameters = ["action":"heartbeat"] let headers: HTTPHeaders = ["Content-Type":"application/json"] AF.request(urlString, method: .post, parameters: parameters

Json Parsing in swift 3 using Alamofire

时光怂恿深爱的人放手 提交于 2020-01-24 19:56:05
问题 I am working in swift 3. I am new to ios. I am trying to parse the json data like My jsonVlaue is : { data = ( { Password = "@1234"; UserName = "<null>"; "___class" = OrderTable; "__meta" = "{\"relationRemovalIds\":{},\"selectedProperties\":[\"UserName\",\"created\",\"name\",\"___class\",\"ownerId\",\"updated\",\"objectId\",\"Password\"],\"relatedObjects\":{}}"; created = 1483525854000; name = TestMan; objectId = "4316DEBA-78C1-C7BD-FFBC-3CB77D747F00"; ownerId = "<null>"; updated = "<null>";

Unable to build Alamofire framework in new Xcode 10.2 (iOS 12.2)

纵饮孤独 提交于 2020-01-24 11:34:32
问题 I am unable to build Alamofire for swift 5 in Xcode 10.2, iOS 12.2, because of the following error SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'Alamofire iOS') Is there a solution to this? 回答1: As for Carthage use github "Alamofire/Alamofire" "5.0.0-beta.3" in your Cartfile 来源: https://stackoverflow.com/questions/55353418/unable-to-build-alamofire-framework-in-new-xcode-10-2-ios-12-2