Intoday's video, we'regonnatake a lookathttpstatuscoatandgoingoverallofthedifferentcodesthatyouneedtoknowinordertodevelopWebapplicationsandwebAPeyestothebestofyourability.
Let's getstartednow.
Soifyou'reunfamiliarwithhttpstatuscodes, essentiallywhattheyare, isthere a wayfortheservertocommunicatewiththebrowserin a reallystructuredwaysothatbothpartiesknowexactlywhat's goingon?
A reallycommoncodethatyou'veprobablyseenbeforeisthe 404 air, whichessentiallymeansnotfound.
Thishappens.
Ifyoutrytogoto a Webpagethatdoesn't exist, theserverisgoingtogiveyou a 44 airsayingthatthepageyou'relookingfordoesnotexist.
And I'm gonnacoveralloftheonesyouneedtoknowandexactlywhattheymean.
Sohere I amon a siteon a WebpagecalledRest A P i tutorialsdotcom.
I'm gonnalinkitdownindescriptionbelowforyoutotake a lookatbecauseithasreallynicedescriptionsofallofthesedifferentstatuscodes.
Ifyouwanttotake a lookandreadindepthwhateachoneactuallymeans, buttheirspecificstatuscodethataremuchmoreimportantandmorecommonthananyoftheothercodesandthosetheones I'm gonnacoverinthisvideo, theonesthatyoureallyneedtoknowtodevelop a p i's andWebpagesand I'm gonnagobythecategories.
There's fivedifferentcategoriesherewe'regonnacover, whichis 100 to 500.
Thenextmostcommon 200 codeyou'regonnaseeistheto a onestatuscode.
Andifyou'rebuilding a rest, A P I, forexample, allofyourpostrequesttocreateresourceis, forexample, createusercreateitem, createshoppingcart, whateveritiswhenyoucreatesomethingon a P I youwanttoreturn a two a onestatuscodewhichessentiallysayscreatedItjustmeansyoucreatedsomeresourceanditwassuccessful.
Youcouldreturn a 200 statuscoatandtechnically, thatwouldbeokaybecausetheybothmeanokay, butsending a two a onegivesthebrowserjust a littlebitmoreinformationsothattheyknowthatyouactuallycreatedsomething.
Let's saythatthey'rejust a basicuserandtheytriedtoaccessanadminfeatureinthe A P I.
Theserverwouldgivethem a 403 whichjustsays I knowwhoyouare, butyoudonothavepermissiontoaccessthis.
So I'm goingtosayyou'reforbiddenfromthiswith a 403 Youcannotaccessthis.
Youneedtohavebettercredentials, admincredentialstoaccessthissectionoftheapplicationaskindofthedifferencebetween 401 and 40341 says, I havenoideawhoyouare.
And 403 issaying I knowwhoyouare, butyoucannotaccessthis.