All language subtitles for 008 Issuing HTTP Requests_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

In the last section, we imported just the jet function into our Abdah Dart file.

So now we're ready to use that jet function to make a request over to that JSON API endpoint inside

of my FETs image method right here.

I'm going to call get the first argument to the jet function is the URL that we want to make a request

to.

To get that Yoro, I'm going to go back over to my browser where I still have the JSON placeholder type

I code dot com you URL inside of my address bar.

So I'm going to copy this.

You are all right here.

And then I will put it in as the first argument to my get function as a string like so.

Now, if we make a request to photos that's going to retrieve all five thousand photos that are posted

at the CPI and that's definitely not what we want to do.

We only want to get one specific photo at a time.

So to indicate which photo we want, I'm going to put a slash at the very end.

Oops, slash at the very end.

There we go.

And then we'll write out the ID of the photo that we want to fetch.

So chances are that we want to start with the ID of one, because that's the first photo there is inside

this collection.

And then get photo two, three, four, five and so on.

So for that, we can reuse the counter variable that we had previously created.

Remember, we start off counter as zero and then every time a user presses the button, we will increment

that counter variable by one.

So I'm going to use a little bit of string interpolation here and I'll put on counter at the very end.

But you'll notice that any time that counter is initialized inside of our asset class, it starts off

as zero and there is no photo with ID of zero.

If we go back to that photos endpoint, the first photo inside the collection has an idea of one.

So I'm going to make sure that I don't try to get a photo with idea of zero by just incrementing the

counter variable by one right before we make that request.

So we can absolutely increment countered by one by using the syntax right here.

We could also write out simply counter plus plus, which has the same effect, counter plus plus will

increment the counter variable by one.

OK, so that looks pretty good now before we try to test out anything here.

There's one thing I want to remind you about that I very briefly pointed out in the last section, if

we go back over to the documentation for our dysfunction, here is the jet function we pass in the URL

as the first argument.

You'll remember that I mentioned that the jet function returns something called a future.

So we need to have a quick discussion about what a future is, because it's a very important concept

that's going to come up many, many times throughout all the other applications that we're going to

build in this course.

So we'll take a quick break, come back the next section and talk about what a future is.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.