Upgrade to Pro — share decks privately, control downloads, hide ads and more …

swift warm up NSURLQueryItem

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

swift warm up NSURLQueryItem

Avatar for Johnlin

Johnlin

May 08, 2018
Tweet

More Decks by Johnlin

Other Decks in Programming

Transcript

  1. URI • Uniform Resource Identifier • ౷Ұࢿݯඪࢽූ • መࡍ্զ၇༻తጯ֘ੋ URI

    • ࡏ2002೥8݄ɼRFC 3305ࢦग़ɼᦒવज़ޠʮURLʯနඃኍᔟ஍༻ԙ ೔ৗ༻ޠ೭தɼୠଖຊ਎ቮزݷඃኑغɻଖݱࡏతޭ༻ɼᷮੋ࡞ҝ ሣԙ๭ࠣURIҼแؚ๭छࢦࣔஶ໢࿏Մୡੑతڠఆࣕ࡞ҝҐᅿଘࡏ తఏ੧ࣕቮɻجԙURIత䱾ଟඪ४ɼྫ೗ࢿݯඳड़ᐽՍ౳ɼቮៃਗ਼ ુ஍ද໌ɼࢿݯඪࣝຊແधࢦग़௨ա໢ࡍ໢࿏֫ಘࢿݯ෭ຊతํ๏ɼ ຠແਢࢦग़ࢿݯੋ൱جԙ໢࿏ɻ
  2. NSURL -> URL • ༻ိṶଘҰݸ URL • ࡏ Swift ༗ఏڙ

    URL ိऔ୅ᢜత NSURL • URL ੋ Struct, NSURL ੋ Class • 䈕Ҋ໵ੋ url
  3. URLComponents • ՄҎ༻String ҃ URL ိ init, ໵ՄҎኺ಄૊߹ • ໵ՄҎ᫚׵ճ

    URL • ՄҎଘऔ࿨मվཫ໘తҰ෦෼ɼ૾ੋ host, port, path, query, queryItems ౳౳
  4. Alamofire • େՈ࠷ৗ༻త http client let urlString = "https://httpbin.org/post" Alamofire.request(urlString,

    method: .post) let url = URL(string: urlString)! Alamofire.request(url, method: .post) let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true)! Alamofire.request(urlComponents, method: .post)
  5. Q&A