200
-
[iOS] status code가 200일 때 빈 응답이 들어오는 경우공부/iOS 2024. 2. 17. 15:04
배경 Alamofire로 빈 타입으로 파싱을 시도하던 중에 오류가 발생했다. 응답은 status code는 200으로 들어오고 body가 비어있었는데, responseDecodable에서 "Empty"로 파싱을 시도했지만 inputDataNilOrZeroLength 오류가 발생했다. 해결법 해결법은 간단하게도 emptyResponseCodes 파라미터만 추가하면 됩니다. emptyResponseCodes에 성공시킬 응답코드를 담은 배열을 추가해주면 오류가 해결됩니다. func requestVerificationCode(email: String, completion: @escaping (Result) -> Void) { let urlString = "http://localhost:8080/member/se..