Umahluko phakathi kwezicelo ze-PUT kunye ne-PATCH

Nguwuphi umahluko ophambili phakathi kwe PUT kunye PATCH izicelo, kwaye kufuneka sisebenzise nini enye ngaphezulu kwenye?

I-PUT kunye ne-PATCH zizenzi ze-HTTP kwaye zombini zinxulumene nokuhlaziya izixhobo.



Umahluko ophambili phakathi kwezicelo zePUT kunye nePATCH

Umahluko ophambili phakathi kwe-PUT kunye ne-PATCH izicelo zikwindlela yeseva eqhubekeka ngayo into evalelweyo yokuguqula ubutyebi obuchongwe yi-Request-URI.


Kwi PUT isicelo, into ebiyelweyo ithathwa njengenguqulelo eguqulweyo yesixhobo esigcinwe kwiseva yemvelaphi, kwaye umxhasi ucela ukuba kugcinwe ingxelo egciniweyo.

Nge PATCH, nangona kunjalo, into ebiyelweyo iqulethe iseti yemiyalelo echaza ukuba oovimba ngoku abahlala kwiseva yemvelaphi kufuneka bahlengahlengiswe njani ukuze bavelise ingxelo entsha.


Kwakhona, omnye umahluko kukuba xa ufuna ukuhlaziya isibonelelo nge PUT isicelo, kuya kufuneka uthumele umrhumo opheleleyo njengesicelo ngelixa nge PATCH, uthumela kuphela iiparameter ofuna ukuzihlaziya.



Idibeneyo:

Masithi sinesixhobo esigcina igama kunye nefani yomntu.

Ukuba sifuna ukutshintsha igama lokuqala emva koko sithumela PUT isicelo soHlaziyo


{ 'first': 'Michael', 'last': 'Angelo' }

Apha, nangona sitshintsha igama lokuqala kuphela, nge PUT Isicelo kufuneka sithumele zombini iparameter kuqala kunye neyokugqibela. Ngamanye amagama, kunyanzelekile ukuthumela onke amaxabiso kwakhona, ukuhlawulwa ngokupheleleyo komvuzo.

Xa sithumela PATCH isicelo, nangona kunjalo, sithumela kuphela idatha esifuna ukuyivuselela. Ngamanye amagama, sithumela kuphela igama lokuqala ukuvuselela, akukho mfuneko yokuthumela igama lokugqibela.

Ngesi sizathu, PATCH Isicelo sifuna umda wendlela omncinci.