티스토리 뷰
후 내 4시간 돌려줘요...
"
Because the ? isn't part of a path. It's a separator to signal the beginning of the query string. You can read about the different components of a URL in this article. Each component has its set of valid characters, anything not in that set needs to be percent-escaped. The best option is to use URLComponentswhich handles the escaping automatically for you:
"
var urlComponents = URLComponents(string: MyRouter.baseURLString)!
urlComponents.queryItems = [ URLQueryItem(name: "username", value: "jsmith"), URLQueryItem(name: "password", value: "password") ]
let url = urlComponents.url!
'macOS, iOS' 카테고리의 다른 글
RxSwift subject/driver/behaviorRelay (0) | 2019.12.14 |
---|---|
인코딩이 깨져서 나올 때 (0) | 2019.12.14 |
[iOS] alamofire에서 response의 request 보기 (0) | 2019.12.14 |
iOS UUID 가져오기 (0) | 2019.12.13 |
firebase push 메모장 (0) | 2019.12.13 |