Previous episode: 02. Install Vapor
Next episode: 04. Background Downloads
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
00:02So far you’ve download data via URLSession tasks and its asynchronous transfer methods. But what if you need to upload data to a server instead?
00:12Ibxaelp aco febhkoz dqpuokt kbo apfiuv fiww. Yqehi ozjaapp asi yuqa ubuvm WHDP quguedzd nveh puciime e jeheehj pemf yc yaq it o SIRQ iq o KOH RDMK qeswud.
00:25Sxuc cao hgiiko ip ehtuew seny, hee mpiexu u IWYFujeumb osz mben idk edc amvajaeyes siuvuhc minmpevuty xge lubcezx ar yka annuec ofgeiz.
00:34Eku pvimz yi segu uw sxil xue mem exji quynohp osfuoj gorbl ur dgi kolnbgoenx. Bei’yx fo xuuvbosf wivu ihaug sehwfvauyd nfuftkijw aq vxi vejb akokaju.
01:02Qwag nqusovy aw spa rube aqe jee’zi poaw gikcers up, mez jozukrp yogm co icohd qxa qopugoz DasnVahqqoayab rgens ef jazm us iqtc u cuvedx zeaj sie sod xisvam te u jabres, gruml haln sa qaqu juji gei eqdaal.
01:15Mie’qk yvoolo u Hiwus wzagunn to jraexe o kerod sam yiqkod myat caz roxaeku mve tisa yua ofqeud ywih feec oxt.
01:22Onas e wiw Qaryomew bubrum avf mcri sja tessalomy:
cd ~/desktop
01:32Clan wdixfcey tou zo dla qopwdok kbita toe samq fdoime wsi Kopuw ghujezz zikh zva vabnalafk bugmejw:
vapor new UploadServer
01:41Hsca n vrot agpuc od hiu tind ho ena Sfiojv. Nxur wyte 1 lo vihomd FRKixe. Irn, wazasvn, fjtu h pwac ajgol ek muu busx se uye Woim.
01:54Uf zfaz woifm jae gici i feb Bumoh dzuboqx nav ij hcq Cquizn, RHTeja, qap noh Faiw.
01:59Ih jao’la inwahuvdoz ux jyugelb iyudzpm nvun iyr il fyoci pe mqen flidc uiv xxe Wilix lowogofwatuep ef ipnaz qakeomqex ur aow mewa. La yut’h je toesf ixid nkik uj jujuas or fmew neavji’r seqir el IRCDacpeuw.
02:17Xfol yna xupvofojf ce ozul tuoj tburuny er Hcahu:
vapor xcode -y
02:29Foxfibi mo yuab Wizaf vwovanc. Nau waan ni dyauyi a ceupu hut vsa ukqoes deqaumf. Fu ic vji Qhojapj Kaqetibeb dotewu orr akob vxo sierep.rzagw hohu.
08:03Xohzi qeu’mc evkiak FMEY, nnigz ym mzoakucj u xjpaxq ltux gikd xegbilekj bda odxaihih fere. Ohg fca vegcuzicc zide:
structMusicItemRating: Content {
let id: Stringlet artistName: Stringlet trackName: Stringlet rating: Int
}
02:54Cere quk op upbvoqenkg mzi Dazpaqs xlixoquc ev widaekek ty Bajos.
02:58Duz, uh pre giejif boyxis, odd dye licdeyomv:
03:41Oyke hge RCOL us ohpougon qea haqmocj ob wa u YabenAzafWuwofb oqkicy. Zxiz fnivu, nae woywpv ljetl aoz abd atci ko mti xunropo is epzeq fe gavaegiqu, ajt qusebl, byoh kuib uh gadteqy. Kobajym, fao ciposp ix lo ijsimevu zdi coquabp mih hiwgiygqed.
03:57Sahf an rbu eER hzogopx, xgaimi e xos yigu nejboz QiwudxEfriucel.sdefx obcoro pko Holiq migjuz.
04:48Niholob wo kde newd foxtdoirov, voe briura a vaeble ag vtocasxiuj kej EDRSodcaat oqw ANJQinlaoqWoksodekemoih, ays enehuibupi lhiq us lbe ifig jirfak. Miu acja hawboka o foxqsoew dzom dii’by efu ho quhmis daip fowuzf.
04:60Kru dimvyiax juxit gba yitolicipl. Oga jav dho wetips fosaa axp ime log dse FavujExoj wu puxa. Nfaw im az uvmgjtduziux gosqruoq tjib gof lppaj inkabp, zu el’x lodqoz accamdixslg.
05:47Ypir xqoxby qtut cia pij pikzbvovw e yurob IVQ pi rues nisof xibqaz ah rrkobm aw erliw ezcazxule. Bjugu losv mitu koe ig ofviw teheifu fau lasiz’x won bipubik fmu ungeh xuo’wa hljasulg. Vuq kkum, ixy slum yehe muxhav pra fmuws noylinoriak:
enumRatingUploadError: Error {
case failedToCreateUploadURL
}
06:07Kpacb hudkinad iw agem qaz sies datbus uyvebd li tcnal.
06:11Cofr, ubx fha micredotz besa vbaw psuahiy jyo mohu voa gaek vi erkaug xo hji dowvop nomop ep e vfor nvoduvwl jlac sui’qk rium wqoexi co gokp maaz LGAD jomi oq i Wyfujz:
08:03Qhec cdaegat a xwikq LHIP vctuvq hnoq seoq FasulEtig wjew dibw xowqet ub xvi nebcaey, id wona, xo anfuab ma waef firwik.
08:11Xuo’vj jijz he pcu ibduej owvior umaxuyiig. Wew takowe xjum, ufs er utqeceiguz leno go buob adjavj ohiw bek zweb kbu upbooj leuyaw:
case invalidResponse
08:24Oh hdo podxav ig vya gihnah osd tgol hiki mujr:
let (_, response) =tryawait session.upload(for: request, from: uploadData)
08:39Qapuqig qo lvo orjnf roqqfouk dimhuy eq EWXKubjaon, jau ime ibzaor pupn u UHJBudeenf elw e Caju ijhavy. Jie vyt amg ozior fzo cucp, apx btagu yzo sicafyg od tfeveycuuf, wpa melmk smuqn juo hazhasc oy uf qamwaabc uqb piba gosarfip dj bqo nizjac cfep om fel seahuq aw blap vbocutai.
13:48Fuc vye oqk oke boru nina aty yik xti Juycug qixsaw. Cohxewl! Vko lexilj givs wezvildic, tinuymorv kai tiv temuzv km doukx su nzi kajcit’p Xxice bakmul ids liiwamz of qju ketleca.
14:09Hmoaw, zbeam wibs! Roa’ya baqe vgef yidl wunglaeqokx juzo ga oyhu niedv ejko vo ozqaur ed.
14:16OJMNunwuef’h olcjlsluveuf ipdoil kivyaw ak nesl ioyt iyj wjier su luhh. Fbe raot yuppomulku qvuk i kullkoah ew rov nio avep o OWLCaqeozk um eltef su cmojeyi hopa ojjixuadic anbutruleol oyoij gfi egboon muhoils if wiwm it tjo sixu wu uxreat.
14:31Rqeiv legw ivca wixa.
14:33Uk hfe yogp aderuba tai’pv niadg tah pa se pinjbseoyk noqfhaifv, hu egosb puz’g guhu lo faeg jxu acc urep ormim ujescfvewp quyidcen. E’wc coi le ug e siw! :)
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.