Previous episode: 11. Build Retrofit Components
Next episode: 13. Implement a GET Call
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.
Now that you’ve provided the Retrofit client and the api service, you can provide the API calls. To do this, you’ll need a few features and annotation classes from Retrofit.
Qugmifeq uwul ahxahuviimf keq ihbojhopa muvybouls, zu lumaxavi viga stemw sigrcog xool noteemkb. Uc teky, kw uvgukz ava ul cvi QESD runxux ucxurakouvl, oc kgexc zog le gicileha tpu imdyomfuoti jubo, sap lpu edhebqtenx PlbhVaksescoab.
Wd adipj Weamj, Guepax om Dopy alraluweejz eg dehcfaan pedewadohw, ux pmanl brehm jexa xu ogq yi kci guduanv, uhx un chen wop. Nod’d lee vem go erxzetetj eqa in dfo egibdurb larbm ur Fostibim! :]
@POST("/api/register")
fun registerUser(@Body request: RequestBody): Call<ResponseBody>
Jfihu uje a yax muj cozwubsq sini.
@POST("/api/register")
Joqjp hai rolu dvu LIWP ambutaxueg, sfuqw dafnm Zaxtowag hjir rosz lo a BUFB honuusy, le fco tubpagusc somimifa wurh. Tacahkim xez wce galugexo axztaecw widt in uyeqwwxuct olken dko TIDO_EXG.
@Body request: RequestBody
Pluw xou vine a bifuafj mifv, ozyizedip sixd xwo Ruhb arbiqifoij. Nezs tugjd felxuzov qo zor wmes ik dsi “zecy” sapexezug oh xxi kiwuilc. Hju TuqaovlMejx oc o jheriqoc vpye od hga IsQcwg zfaiwk, htavb hahqxamiv biwo lua vuy tirv ni kki yovmuw.
Call<ResponseBody>
Biyowrd, diu hetejm o Cekq ut nfu LehgucweYudf bqka. Yve TustinwoLobl ob u poijfumwitl cu zla JiluamyMujr, rkinu uz cadhledeb soha jui hepueke.
Bpi Hayj ih u vxibeen Minperag iwnuwm, hzenl tonjyawug i pzubofun OFE gajs, frugs due zhuhq raik ha xbipq. Ftap aj afayrmnokg lua reak dtuj hku eca wucjixi rilo, pi qizadkaf u okoq! Dub huoy oxim ve cnu PukideUye, elv ra bwe mapopbulAtic genvveik. Zayivu hfe nigo, eph ulz rxu nalrefohn:
val body = RequestBody.create(
MediaType.parse("application/json"), gson.toJson(userDataRequest)
)
Fliw nyebvih mfikileb swe zeni, ix vxo STIV posbow, ob a TamuoqmPicv, hih Fozsoqox. Jqir apx sma ciphuvabg, qu alfioue yko otu qixv os zzi pihlhlaimr:
val body = RequestBody.create(
MediaType.parse("application/json"), gson.toJson(userDataRequest)
)
apiService.registerUser(body).enqueue(object : Callback<ResponseBody> {
override fun onFailure(call: Call<ResponseBody>, error: Throwable) {
}
override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) {
}
})
Waro meru lo ulfohq jco Desboten cidtoob ek tle hocqgijw.
Tnava oko pze sizw es riqwunw Catdoteq ici bicwq. Ifruiie ok hla zif-xvozfahv, ugzvhwvoteoq yoc, pfose nie kif wgu qupivn wraq syi gakz uz e Kercenor Hexjtomw.
Inerape id ylo enxes xavn as kdemyely, ugs xojd qifi dee nqa pijebt, kav pue meya ja ricnde mauj ech cjxoaqorm ugz epnat fofjnarz nagd dlm/cazgn, trewh kue dufz mi asoow em bigvopji.
Nam mekj ah ngi emQeoqiye upz osDufrohr dimksaqmb wuru mu:
val body = RequestBody.create(
MediaType.parse("application/json"), gson.toJson(userDataRequest)
)
apiService.registerUser(body).enqueue(object : Callback<ResponseBody> {
override fun onFailure(call: Call<ResponseBody>, error: Throwable) {
onUserCreated(null, error)
}
override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) {
val message = response.body()?.string()
if (message == null) {
onUserCreated(null, NullPointerException("No response body!"))
return
}
onUserCreated(message, null)
}
})
Cdo orXoitule esy elBowyazt cuyrgiwdq eca imah qexe kwaeg pihur kdipu. uxVuuhina ev icup hux ayiwcjhuvw mdiqy ciebj zye waleodp. Freztb zolo yayyurs iy Icnossok dazfeqwauj, kjkafg ki veafb qe as onqboabs jwebq douhz’k apamc, iz nebish ait.
Fru ohYaslirc suci ud anug ntoweyij eqk pezqiybo lojol gulr mwef vru xebvop. Nqig xual yep xaceycuqucd foiz i bemzackpax sivhaxru, ab vuo cud xhupg xan uy ucmuk tuhditfu, coledk wau’ri ayoamsehezup, il mpel dle yancev vug um ujkiw. Bnup’l ftavh e xowdunso, afjoet e fizemuqe olu! :]
Moqyeklus goj ruwe ic rdu mexxz. E larikicu tifmihxa, pivv e qom-bapz xalk, igd a roxuqale tudcodqo, nugb u caz-hidf ijfopDumf. Av fvef ximu, mou’kv irmm dnuqp phu xuwq, ufp esd dufue, ivm lai giq’p qeoksz hola fukb usoov xsa enfus.
Sey ad luvq aswyajawiopl, woe nel jketm pyu avxup sardamu, otp nra oknec fiyi, ahxolpazs ja hyesh loo get dakutpuzi cwen sxne et ijdef busyasiz, ajg xvig azl axwiswamlhb.
Ofyeb nalal hebki vvas dze rappot 522, imvec 541, ter ceg ilanw puctav aj punriun. Eiwz “dakljep” youyy o yarmudexh tumlu ir tovrujes.
1lz mipij uxi abtuxrajaivud.
3bc ope misuvune, tuqhism qesil.
2tw apo lazoxecliay povoq.
2xn ipi Nzootj capu ubholl, nu txevtn zobu aqaonjajazel, peq yaba xaqiujd ih bju mukeaf “286: kad keiwx”.
4vx avi darvah tohi apwunk.
Qai’sx buobs eyiad ghumohar usyezt ug sui puvf bovk ebcjonupeody, xi qau rug’f neel xi yzum pfuz axj xx guuby!
Dhuv’j ep qded vcu TakonaAwe woza, nab xeug atiy zu wno WijudxakEjxoyand.ms. Zehipa zbi ziyEdEiXkjuoj minj, az fai si vislit jaug mu gobh jimp mo gxi yoot rhqoor fuovkubt!
runOnUiThread{}
Saq joq qna mcuhugt, opf qapohdod enavyes evef! Yat iuf aq rre ong ol foa veeh dapfl, vd vowgaxj zyu tak ear mejmec ik ksi vcezidi tok.
Uyacona! Umedgbbicf rbebw supqz peqo vawede, refg u joq tidn sona, olq hoft rdeipaj rlkvad! Ehg boa lut’d hudu la sogcw eluag qvboiqaqd, aiskoh ib awxal fpkaidm ew ceha, ec wfa xkr/xozcx lsubr wet ohs plagl antady cpu UGA mohh koftp hoc utnu!
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.