일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- iOS16
- Swift
- geofencing
- Git
- FLUTTER
- Notification
- JPA
- 이미지
- IOS
- Code
- 웹뷰
- window
- Apple
- 개발자
- darkmode
- error
- rxswift
- Firebase
- UIButton
- Xcode
- appstore
- github
- Session
- view
- Realm
- Archive
- mac
- 한글
- MacOS
- SwiftUI
- Today
- Total
목록Request (3)
EEYatHo 앱 깎는 이야기

Moya 에서 네트워크 통신에 접근할 수 있는 방법 2가지 Interceptor Plugin Interceptor #git RequestInterceptor의 구현체를 MoyaProvider.Session 에 넣기 let insterceptor = MyInterceptor() let session = Session(interceptor: insterceptor) let provider = MoyaProvider(session: session) adapt 로 모든 request 에 접근 retry 로 validation 에 실패한 response 에 접근 /// Type that provides both `RequestAdapter` and `RequestRetrier` functionality. publ..

에러 배경설명 API 호출시 아래와 같은 에러가 나옴 status code : 1103 NSLocalizedDescription : 리소스가 최대 크기를 초과함 Solution iOS 13 이상에서 나타나는 버그이다. API 호출 시, request 의 httpMethod 를 GET 이라면, httpBody 를 비워야한다... 🫠 body 를 통해 데이터를 전달하고 싶으면, API 가 POST 를 지원하도록 하고 사용한다. GET 을 유지하고 데이터를 전달하고 싶으면, header 나 url query를 사용한다. Reference https://stackoverflow.com/questions/56955595/1103-error-domain-nsurlerrordomain-code-1103-resourc..
1. Content-Type image/png로 그냥 보내기 // 리퀘 생성 var request = URLRequest(url: URL(string: requestUrl)!, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 7) request.httpMethod = "POST" // 리퀘 헤드 request.setValue("image/png", forHTTPHeaderField: "Content-Type") // 리퀘 바디 request.httpBody = image.pngData()! 2. multipart/form-data 이용하기 ( 바디에 다른 Content-Type들 담기 가능 ) // 리퀘 생성 var request = URLRequest(..