HTTP REST API yog dab tsi?
HTTP REST API yog dab tsi?

Video: HTTP REST API yog dab tsi?

Video: HTTP REST API yog dab tsi?
Video: Tsis Tau Txaus Koj | Kong Chue (Official Music Video) 2024, Hlis ntuj nqeg
Anonim

Ib RESTful API yog ib qho program program interface ( API ) uas siv HTTP thov kom GET, PUT, POST thiab DELETE cov ntaub ntawv. REST thev naus laus zis feem ntau yog nyiam rau qhov muaj zog dua Cov Khoom Siv Yooj Yim Siv Tau Zoo (SOAP) thev naus laus zis vim REST leverages tsawg bandwidth, ua rau nws zoo dua rau kev siv internet.

Tsis tas li ntawd, REST API txhais li cas?

A RESTful API yog ib qho program program interface ( API ) uas siv HTTP thov kom GET, PUT, POST thiab DELETE cov ntaub ntawv. Ib API rau lub vev xaib yog cov cai uas tso cai rau ob lub software sib txuas lus nrog ib leeg.

Qhov thib ob, REST API piv txwv yog dab tsi? Piv txwv : GET thov rau /user / rov qab cov npe ntawm cov neeg siv sau npe rau ntawm qhov system. POST thov rau /user/123 tsim ib tus neeg siv nrog ID 123 siv cov ntaub ntawv lub cev. kev thov PUT rau /user/123 hloov kho cov neeg siv 123 nrog cov ntaub ntawv lub cev.

Kuj paub yog, yog HTTP REST API?

Tsis yog, lawv tsis yog. HTTP stands rau HyperText Transfer Protocol thiab yog ib txoj hauv kev los hloov cov ntaub ntawv. Nco ntsoov tias tseem muaj qhov sib txawv loj ntawm a RESTful API thiab a HTTP API . A RESTful API adheres TXHUA tus REST Cov kev txwv tau teev tseg hauv nws cov ntaub ntawv "hom ntawv" (hauv kev hais tawm ntawm Roy Fielding).

REST API vs API yog dab tsi?

REST Hauv paus yog ib qho qauv ntawm lub vev xaib architecture uas tswj hwm tus cwj pwm ntawm cov neeg siv khoom thiab cov servers. Thaum API yog cov txheej txheem ntau dua ntawm cov txheej txheem thiab tau siv los ntawm cov software los pab nws cuam tshuam nrog lwm cov software. REST tsuas yog npaj rau kev siv web. Thiab feem ntau cuam tshuam nrog HTTP thov thiab cov lus teb.

Pom zoo: