For getting help with Alamofire -- basically I have one request and it just seems to execute the Success block in a .responseJSON even though the error code is 404 and I'm at a loss as to why this is happening.
Maybe I'm in the wrong place but was hoping someone could point me in the right direction.
Jon Shier
@jshier
@Dev- Without a validate() call as part of your request chain, no status code validation is done, so it’s treated as a success.
sean dev
@Dev-
Thanks -- that helped! Out of curiosity how can I read the body of a response in the failure block after a HTTP failure error code is received or has it simply not been serialized by Alamofire?
Alexis A. Banaag Jr.
@aabanaag
Any help regarding setting up the simulator for xcode 10.1? *** Building scheme "Alamofire iOS" in Alamofire.xcworkspace Could not find any available simulators for iOSgot this error when trying to run carthage update --platform iOS
Alexis A. Banaag Jr.
@aabanaag
Hello, Any documentation for the Alamofire 5 beta?
Jon Shier
@jshier
@aabanaag Just the inline documentation right now. Feel free to ask questions in our topic on the Swift forums, or quick questions here.
Ted Butler
@brimestone
Hey guys, Im new to Alamofire and started using version5 (beta) is there a document reference out there? Im constantly getting confused with the current doc + conversion to what it might be for version 5
Jon Shier
@jshier
@brimestone Currently we only have inline and generated documentation, no guidance documentation. We’ll be rewriting it soon. In the meantime, asking specific questions on our Swift forums (https://forums.swift.org/c/related-projects/alamofire) is probably the best way to get answers.
Ted Butler
@brimestone
Thanks!
AJBeltran3
@AJBeltran3
Hey everyone, looking into starting a new project, not sure whether to go with alamofire 5 beta or back to 4.8.1 to start? Any suggestions?
Jon Shier
@jshier
@AJBeltran3 I’d suggest starting with Alamofire 5, which just hit beta 2. New architecture, new features. Feel free to ask questions on our Swift Forums section.
Gunter
@kwontaewan
hello guys
May I ask you my issue?
"=======================================" 2019-02-21 17:56:27.685045+0900 Alamofire-SSLPinning-Issue[2860:2368515] CredStore - performQuery - Error copying matching creds. Error=-25300, query={ class = inet; "m_Limit" = "m_LimitAll"; ptcl = htps; "r_Attributes" = 1; sdmn = "surf.ddns.net"; srvr = "surf.ddns.net"; sync = syna; } $ curl -v \ -H "User-Agent: Alamofire-SSLPinning-Issue/1.0 (com.oleg.sample.Alamofire-SSLPinning-Issue; build:1; iOS 11.4.0) Alamofire/4.8.1" \ -H "Accept-Encoding: gzip;q=1.0, compress;q=0.5" \ -H "Accept-Language: ko-KR;q=1.0" \ "https://surf.ddns.net:8443/terms" "=======================================" 2019-02-21 17:56:28.552891+0900 Alamofire-SSLPinning-Issue[2860:2368575] CredStore - copyIdentPrefs - Error copying Identity cred. Error=-25300, query={ class = idnt; labl = "https://surf.ddns.net:8443/"; "r_Ref" = 1; } 2019-02-21 17:56:28.565525+0900 Alamofire-SSLPinning-Issue[2860:2368575] [BoringSSL] Function boringssl_session_errorlog: line 2866 [boringssl_session_handshake_continue] SSL_ERROR_SSL(1): operation failed within the library 2019-02-21 17:56:28.566811+0900 Alamofire-SSLPinning-Issue[2860:2368575] [BoringSSL] Function boringssl_session_handshake_error_print: line 2805 boringssl ctx 0x1022765b0: 4411365856:error:10000410:SSL routines:OPENSSL_internal:SSLV3_ALERT_HANDSHAKE_FAILURE:/BuildRoot/Library/Caches/com.apple.xbs/Sources/boringssl/boringssl-109.50.14/ssl/tls_record.c:547:SSL alert number 40 2019-02-21 17:56:28.567191+0900 Alamofire-SSLPinning-Issue[2860:2368575] [BoringSSL] Function boringssl_context_get_os_status: line 4268 SSL_AD_HANDSHAKE_FAILURE 2019-02-21 17:56:28.579089+0900 Alamofire-SSLPinning-Issue[2860:2368575] TIC TCP Conn Failed [1:0x1022552c0]: 3:-9824 Err(-9824) 2019-02-21 17:56:28.580169+0900 Alamofire-SSLPinning-Issue[2860:2368575] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824) 2019-02-21 17:56:28.580533+0900 Alamofire-SSLPinning-Issue[2860:2368575] Task <EFDC6262-1F45-463E-A7EF-5D24B510DF7D>.<1> HTTP load failed (error code: -1200 [3:-9824]) 2019-02-21 17:56:28.581979+0900 Alamofire-SSLPinning-Issue[2860:2368574] Task <EFDC6262-1F45-463E-A7EF-5D24B510DF7D>.<1> finished with error - code: -1200 no response Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x10227abb0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9824, NSErrorPeerCertificateChainKey=( "<cert(0x103019a00) s: surf.ddns.net i: Let's Encrypt Authority X3>"
), NSUnderlyingError=0x102284730 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=1, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x10227abb0>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9824, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9824, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x103019a00) s: surf.ddns.net i: Let's Encrypt Authority X3>" )}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://surf.ddns.net:8443/terms, NSErrorFailingURLStringKey=https://surf.ddns.net:8443/terms, NSErrorClientCertificateStateKey=1}
I tried searching for the error code in the github issue, but it does not work.
Hi, for those wanting to try out the beta version-- is there any documentation you're tending to refer newcomers to for a basic common API calls (JSON/post etc)
Jon Shier
@jshier
@doobeh The high level APIs are very similar to v4, so that documentation should still work, though you need AF.request instead of Alamofire.request. We’re still working on the rest of the documentation, so let us know if you have any usage questions, either here or on our Swift Forums.
_
There is also a new set of top level APIs which accept Encodable parameters and not just [String: Any] dictionaries, use those if you can.
Martin WIRTH
@martiwi
Hi there, any idea when the version 5.0.0 would be released (approximately)?
Jon Shier
@jshier
@martiwi As soon as the documentation is done. Soon is as close as we can get at the moment.
Anup Deshpande
@anup-deshpande
Hello People,
I am trying to get alamofire work but its not working. It keeps on saying that swift version 5.0 is not supported. So I changed the version to 4.2 now it is showing multiple errors
Martin WIRTH
@martiwi
Thanks @jshier
k4b00m-Hozaifa
@k4b00m-Hozaifa
Alamofire swift UI integration ?
Jon Shier
@jshier
@k4b00m-Hozaifa Nothing specific is needed to use it with SwiftUI, as we already support SwiftPM. You can add the 5.0.0-beta.6 version to Xcode 11 using the built in SPM support. However, I do have some prototype Combine integrations online on the feature/initial-combine-support branch.
k4b00m-Hozaifa
@k4b00m-Hozaifa
Nice thanks
Eni Sinanaj
@enisinanaj
guys I have a question
I'm making a multipart upload request to my server and almost everything is fine
but the content-length header is missing for each content part
any idea why this might happen or how to activate it ?
Eni Sinanaj
@enisinanaj
the version I'm using is just ignoring the length when appending something to the multipart request.
Jon Shier
@jshier
Which version are you using? And how are you building the multipart form?
Eni Sinanaj
@enisinanaj
sorry for the late reply. I found the issue. it was with the content-length. I added the headers manually to every part of the multipart request including the missing content-length
I'm using version 4.8. cannot use a newer version because I need to have a deploy target 9.0
Ediro43
@Ediro43
Hello , in old alamofire in order to get the JSON from a weather site ( OpenWeatherApp ) you could simply use AlamoFire.request(URL_here) and then print the response
now with alamofire 5.0 what can i do to get that ?
Jon Shier
@jshier
@Ediro43 It’s simply AF.request() now.
Lucas Ramage
@oxr463
How can I save an XML soap response to file using Alamofire.request()?
Matthew O'Gorman
@mogorman
i have an endpoint that returns gzipped json. it works fine via curl, but when i use alamofire.request im getting the gzipped json, its not automatically being de gzippped. where should i look to try to solve
everything ive found online says that this just automatically works
also i am using the default headers that are requesting gzip/deflate. the server is responding with content-encoding properly as well
Lucas Ramage
@oxr463
Can you provide a log from your curl example vs your request?
Matthew O'Gorman
@mogorman
i figured it out, the data was being double gzipped some how. alamo was doing the right thing it was my fault