Dab tsi yog API sawv ntsug rau? Thiab Lwm Cov Ntawv Cuam Tshuam: REST, SOAP, XML, JSON, WSDL

Dab Tsi Yog Qhov API Sawv Daws

Thaum koj siv lub khoos phis tawm, koj tus browser ua kev thov los ntawm cov neeg siv khoom neeg rau zaub mov thiab cov neeg rau zaub mov xa rov qab cov ntaub ntawv uas koj tus browser sib sau ua ke thiab qhia lub vev xaib nrog. Tab sis dab tsi yog tias koj tsuas xav koj lub server lossis web page hais lus rau lwm tus neeg rau zaub mov? Qhov no yuav xav tau koj tus program code rau qhov API.

Yuav ua li cas puas API sawv?

API yog qhov ntawv luv rau Thov Programming Interface. Ib qho API yog cov txheej txheem ib puag ncig, raws tu qauv, thiab khoom siv rau kev tsim web-enabled thiab mobile-based applications. Tus API qhia txog qhov koj tuaj yeem txheeb xyuas qhov tseeb (yeem), thov thiab tau txais cov ntaub ntawv los ntawm cov API neeg rau zaub mov.

API yog dab tsi?

Thaum siv nyob rau hauv cov ntsiab lus ntawm kev nthuav dav web, an API feem ntau yog cov kev txhais tau ntawm Hypertext Transfer Protocol (HTTP) cov lus thov, nrog rau cov lus txhais ntawm cov qauv ntawm cov lus teb. Web APIs tso cai rau kev sib xyaw ntawm ntau cov kev pabcuam rau cov kev siv tshiab uas hu ua mashups.Wikipedia

Cov Video Qhia Txog Dab Tsi Ntawm APIs ua

Nws muaj ob txoj cai tswj thaum pib txhim kho API. Cov ntaub ntawv siv lus zoo ib yam li Microsoft .NET thiab Java cov tsim tawm feem ntau nyiam SOAP tab sis cov ncauj lus nrov tshaj plaws yog REST. Zoo li koj sau qhov chaw nyob hauv browser kom tau txais lus teb, koj tus lej dhau qhov kev thov mus rau ib qho API - qhov tseeb txoj hauv kev ntawm lub server uas yog kuaj xyuas qhov tseeb thiab teb kom tsim nyog nrog cov ntaub ntawv koj thov. Teb rau SOAP teb nrog XML, uas zoo li HTML li - cov cai siv los ntawm koj tus browser.

Yog tias koj xav sim APIs yam tsis sau kab ntawm kab, DHC muaj qhov zoo Daim Ntawv Thov Chrome rau kev cuam tshuam nrog APIs thiab pom lawv cov lus teb.

Cov Ntawv Cuam Tshuam SDK sawv dab tsi?

SDK yog cov ntawv luv rau Cov Khoom Siv Tsim Kho Khoom Siv.

Thaum lub tuam txhab tshaj tawm lawv qhov API, muaj cov ntaub ntawv ib txwm coj ua ke uas qhia txog yuav ua li cas lub API qhabnias, yuav ua li cas nws tuaj yeem nug tau, thiab cov lus teb tsim nyog yog li cas. Txhawm rau pab txhim kho kev pib ua haujlwm, lub tuam txhab feem ntau tshaj tawm a Cov Khoom Siv Tsim Kho Khoom Siv kom suav nrog chav kawm lossis cov haujlwm tseem ceeb yooj yim rau hauv cov phiaj xwm uas tus tsim tawm tau sau.

Lub Acronym XML sawv li cas?

XML yog acronym rau eXtensible Markup LusCov. XML yog markup lus siv rau encode cov ntaub ntawv nyob rau hauv hom ntawv uas yog ob qho tib neeg nyeem thiab nyeem tau los ntawm lub tshuab.

Ntawm no yog ib qho piv txwv ntawm cov XML zoo li cas:

<?xml version ="1.0"?>
<product id ="1">
Khoom A
Thawj cov khoom

5.00
txhua

Lub npe JSON yog dab tsi sawv?

JSON yog ib qho ntawv qhia lub npe JavaScript ntawv cim cimCov. JSON yog ib hom ntawv rau kev teeb tsa cov ntaub ntawv uas xa rov qab thiab dhau los ntawm API. JSON yog lwm txoj rau XML. REST APIs feem ntau tau teb nrog JSON - kev qhib hom qauv uas siv cov ntawv nyeem tau rau tib neeg los xa cov ntaub ntawv cov khoom uas muaj cov cwj pwm – tus khub.

Nov yog ib qho piv txwv ntawm cov ntaub ntawv saum toj no siv JSON:

{
"id": 1,
"npe": "Khoom A",
"lus piav qhia": "Thawj cov khoom",
"tus nqi": {
"nyiaj": "5.00",
"ib": "Txhua"
}
}

Lub npe Acronym REST sawv cev dab tsi?

REST is acronym rau qhov Kev Sawv Cev Hauv Xeev Kev Xa Mus kws kes duab vajtse style rau faib hypermedia tshuab. Yog li npe los ntawm Roy Thomas Fielding

Whew… ua pa tob tob! Koj tuaj yeem nyeem tag nrho dissertation no, hu ua Architectural Styles thiab Tus Tsim ntawm Network-raws Software Architectures xa hauv qee qhov kev txaus siab ntawm cov tseev kom muaj ntawm DOCTOR OF PHILOSOPHY hauv Cov Ntaub Ntawv thiab Computer Science los ntawm Roy Thomas Fielding.

Ua tsaug rau Dr. Fielding! Nyeem ntxiv txog SO tom Wikipedia.

Lub suab npe SAP sawv cev dab tsi?

Xab NPUM yog acronym rau Tej Yam Khoom Siv Yooj Yim Nkag raws

Kuv tsis yog tus tsim tawm, tab sis hauv kuv lub tswv yim cov neeg tsim tawm uas nyiam SOAP ua li ntawd vim tias lawv tau yooj yim txhim kho txoj cai hauv tus txheej txheem kev sib sau ua ke uas tau nyeem Cov Vev Xaib Web Cov Lus Txhais (WSDL). Lawv tsis tas yuav txheeb xyuas cov lus teb, nws tau ua tiav siv WSDL. SOAP yuav tsum muaj lub hnab ntawv programmatic, uas txhais cov qauv lus thiab yuav ua li cas txheej txheem nws, txheej txheej ntawm txoj cai tshaj tawm rau cov qauv ntawm daim ntawv thov-datatypes thiab cov lus pom zoo rau cov sawv cev ntawm cov txheej txheem hu thiab cov lus teb.

5 Comments

  1. 1
  2. 2
  3. 3
  4. 4

    Thaum kawg (thaum kawg!) Xaus lus luv luv hais txog ntawm tag nrho cov kev sib cav dhau los no-suab hais tau txhais li cas. Ua tsaug rau koj siv cov lus meej thiab ncaj qha, qhov tshwm sim = lub neej tom ntej uas zoo li me ntsis ci ntsa iab rau tus tub ntxhais kawm tsim tawm no.

    • 5

      Kuv tuaj los Vic, yog… Kuv pom zoo. Cov lus no txaus ntshai. Kuv nco qab thawj zaug kuv tau programmed thov mus rau qib API thiab nws txhua tus nias thiab kuv tsis tuaj yeem ntseeg tias nws yooj yim npaum li cas. Ua tsaug!

Yuav ua li cas koj xav hais tias?

Qhov Web site no siv Akismet los txo cov kev pabcuam. Kawm li cas koj cov ntaub ntawv tawm tswv yim tiav.