He aha ke kū ʻana o API? A me nā moʻolelo ʻē aʻe: REST, SOAP, XML, JSON, WSDL

He aha kā API e kū nei

Ke hoʻohana nei ʻoe i kahi polokalamu kele pūnaewele, noi kāu browser i nā noi mai nā kikowaena mea kūʻai aku a hoʻouna ka mea lawelawe i nā faila i hōʻuluʻulu ʻia kāu polokalamu kele pūnaewele a hōʻike i kahi ʻaoʻao pūnaewele me. Akā pehea inā makemake ʻoe i kāu kikowaena pūnaewele a ʻaoʻao pūnaewele paha e ʻōlelo i kahi kikowaena pūnaewele ʻē aʻe? Koi aku kēia iā ʻoe i ka pāʻālua polokalamu i kahi API.

He aha kāu API kū no?

He akimona ʻo API no Hoʻohui Polokalamu Polokalamu Polokalamu. An API kahi hoʻonohonoho o nā hana maʻamau, nā kuʻina, a me nā pono hana no ke kūkulu ʻana i nā polokalamu pūnaewele a me nā polokalamu paʻalima paʻalima. ʻO ka API kikoʻī pehea e hiki ai ke hōʻoia (koho), noi a loaʻa ʻikepili mai ka API kikowaena.

He aha ka API?

Ke hoʻohana ʻia i ka pōʻaiapili o ka hoʻomohala pūnaewele, an API ʻo ia ka maʻa mau o ka Hypertext Transfer Protocol (HTTP) noi i nā leka, me kahi wehewehe o ke ʻano o nā leka pane. ʻAe nā API Pūnaewele i ka hui pū ʻana o nā lawelawe he nui i nā noi hou i ʻike ʻia nā mashup.Wikipedia

Kahi hōʻike wikiō no ka hana a nā API

Aia kekahi mau kuʻina nui i ka hoʻomohala ʻana i kahi API. ʻO nā ʻōlelo hoʻolālā maʻamau e like me Microsoft .NET a me nā mea hoʻomohala Java makemake pinepine i ka SOAP akā ʻo ka protocol kaulana loa ʻo REST. E like me kāu kikokiko ʻana i kahi helu wahi i ka polokalamu kele pūnaewele e loaʻa ai kahi pane, hāʻawi kāu code i kahi noi i kahi API - he ala maoli i kahi kikowaena e hōʻoia a pane kūpono me nā ʻikepili āu i noi ai. Pane nā pane no ka SOAP me XML, e like like me HTML - ke code i hoʻohana ʻia e kāu polokalamu kele pūnaewele.

Inā makemake ʻoe e hoʻāʻo i nā API me ke kākau ʻole ʻana i kahi laina o ke code, DHC he nui kāna Palapala Noi Chrome no ka launa pū ʻana me nā API a me ka ʻike ʻana i kā lākou pane.

He aha ke kū o ka Acronym SDK?

He akronimona ʻo SDK no Pae Hoʻolālā Polokalamu.

Ke hoʻopuka kahi hui i kā lākou API, aia pū kekahi me nā palapala e hōʻike ana pehea ka API hōʻoia, pehea e hiki ai ke nīnau, a he aha nā pane kūpono. I mea e kōkua ai i nā mea hoʻomohala e hoʻomaka i ke poʻo, hoʻolaha pinepine nā ʻoihana i Pae Hoʻolālā Polokalamu e hoʻokomo i kahi papa a i nā hana kūpono i maʻalahi i nā papahana e kākau nei ka mea hoʻomohala.

He aha ke kū o ka Acronym XML?

He akomi ʻo XML no ʻ Languagelelo Markup eXtensible. ʻO XML kahi ʻōlelo māka i hoʻohana ʻia e encode ʻikepili i kahi ʻano e hiki ke heluhelu ʻia e ke kanaka a me ka heluhelu ʻana i ka mīkini.

Eia kahi laʻana o ka hōʻike ʻana o XML:

<?xml mana ="1.0"?>
<product id ="1">
Huahana A
ʻO ka huahana mua

5.00
kela a me keia

He aha ke kū o ka Acronym JSON?

ʻO JSON kahi akimona no Hōʻike Manaʻo JavaScript. ʻO JSON kahi ʻano no ka hoʻonohonoho ʻana i nā ʻikepili i hoʻouna ʻia a hoʻi ʻia ma o kahi API. ʻO JSON kahi ʻokoʻa i XML. Hoʻonohonoho pinepine nā REST API me JSON - kahi ʻano hāmama i wehe ʻia e hoʻohana ai i nā huaʻōlelo i heluhelu ʻia e ke kanaka e hoʻouna i nā mea ʻikepili i loko o nā huina hoʻoilina – waiwai.

Eia kahi laʻana o ka ʻikepili ma luna e hoʻohana ana iā JSON:

{
"id": 1,
"Ke poʻo inoa Ka": "Huahana A",
"wehewehe": "Ka huahana mua",
"kumu kūʻai": {
"nui": "5.00",
"no": "kēlā me kēia"
}
}

He aha ke kū o ka Acronym REST?

ʻO REST kahi akimona no ka Hoʻolilo Mokuʻāina Representational kaila kuhikuhipuʻuone no nā ʻōnaehana hypermedia i hāʻawi ʻia. ʻO Roy Thomas Fielding ka inoa

Auwe ... hanu hohonu! Hiki iā ʻoe ke heluhelu i ka holoʻokoʻa pepa kākau ʻaneʻi, i kapa ʻia ʻo Architectural Styles a me ka Hoʻolālā o nā Architectures Polokalamu Loiloi Pūnaewele i waiho ʻia me ka ʻoluʻolu hapa o nā koi no ke kekelē o DOCTOR OF PHILOSOPHY i ka ʻikepili a me ka ʻepekema lolouila e ʻO Roy Thomas Fielding.

Mahalo iā Kauka Fielding! E heluhelu hou aʻe e pili ana koena ma Wikipedia.

He aha ka mea e kū ai ka Acronym SOAP?

ʻO ka SOAP kahi akimona no ʻO ka protocol Access Object Simple

ʻAʻole wau he Polokalamu, akā i koʻu manaʻo he makemake nā mea hoʻomohala aloha iā SOAP no ka mea hiki iā lākou ke hoʻomohala maʻalahi i ke code i loko o kahi ʻōnaehana papahana maʻamau e heluhelu ana i ka faila ʻōlelo lawelawe ma ka pūnaewele (WSDL). ʻAʻole pono lākou e wili i ka pane, ua hoʻokō ʻia me ka WSDL. Pono ka SOAP i kahi envelope papahana, e wehewehe ana i ka hanana leka a pehea e hana ai, kahi hoʻonohonoho o nā lula encode no ka hōʻike ʻana i nā hanana o nā datatypes i ho'ākāka ʻia e ka noi a me kahi ʻaha no ka hōʻike ʻana i nā kāhea a me nā pane.

5 Comments

  1. 1
  2. 2
  3. 3

    Mahalo wau iā ʻoe e kau nei i kēia ʻike - noʻonoʻo wau i ke ʻano o ka REST no kekahi manawa lōʻihi. 🙂

  4. 4

    ʻO ka hope loa (hope loa!) Kahi hōʻuluʻulu manaʻo pōkole o ka manaʻo o kēia mau haʻi inoa mua weliweli. Mahalo no ka hoʻohana ʻana i ka ʻōlelo mōakāka a pololei hoʻi, hopena = kahi wā e hiki mai ana e nānā iki aʻe no kēia mea hoʻomohala haumāna.

    • 5

      Aloha e Vic, ʻae ... ʻae au. Weliweli nā ʻōlelo. Hoʻomaopopo wau i ka manawa mua aʻu i hoʻolālā ai i kahi noi i kahi API a kaomi ʻia ia mea āpau a ʻaʻole hiki iaʻu ke hilinaʻi i ka maʻalahi o ka maʻalahi. Mahalo!

Pehea kou manaʻo?

Ke hoʻohana nei kēia pūnaewele i ka Akismet e ho'ēmi i ka spam. E aʻo pehea e hanaʻia ai kāuʻikeʻikepili.