PURECODER_IR Telegram 1102
Pure Coder
چالش یه دونه account داریم که میتونه activate و deactivate بشه حالا میخوایم یه rest api برای activate و deactivate کردنش طراحی کنیم کدوم یک از گزینه های زیر بنظرت بهتره؟ 1⃣ PUT api/accounts/{id} Body : { isActive: true } 2⃣ PATCH api/accounts/{id}…
🔥کوئیز Rest

گزینه ی ۱ طبق استاندارد های رست درست نیست چون که متد PUT برای replace کردن کل resource بکار میره و نه آپدیت جزئی اون.

گزینه ۳ و ۴ درست نیستن چون تبدیل به RPC شدن، همچنین گزینه ۳ آپدیت جزئی ریسورس رو با PUT هندل کرده.

گزینه ۲ طبق استاندارد های رست درست هست، آپدیت جزئی ریسورس و استفاده از PATCH

گزینه ۵ درست هست چون اینجا ریسورس رو محدود کردیم و کلش رو با PUT جایگزین(replace) کردیم.

گزینه ۶ میتونه درست باشه ولی ۵ نسبت به ۶ بهتره چون کل ریسورس رو داره replace میکنه و مفهوم رو بهتر میرسونه.

بین گزینه ۲ و ۵ کدوم یک بهتر هستن؟

هر دو از نظر استاندارد های رست درستن ولی از زاویه دید دیزاین کدوم شون بهتره؟

بستگی به شرایط داره.

@purecoder_ir
🔥6👍1



tgoop.com/purecoder_ir/1102
Create:
Last Update:

🔥کوئیز Rest

گزینه ی ۱ طبق استاندارد های رست درست نیست چون که متد PUT برای replace کردن کل resource بکار میره و نه آپدیت جزئی اون.

گزینه ۳ و ۴ درست نیستن چون تبدیل به RPC شدن، همچنین گزینه ۳ آپدیت جزئی ریسورس رو با PUT هندل کرده.

گزینه ۲ طبق استاندارد های رست درست هست، آپدیت جزئی ریسورس و استفاده از PATCH

گزینه ۵ درست هست چون اینجا ریسورس رو محدود کردیم و کلش رو با PUT جایگزین(replace) کردیم.

گزینه ۶ میتونه درست باشه ولی ۵ نسبت به ۶ بهتره چون کل ریسورس رو داره replace میکنه و مفهوم رو بهتر میرسونه.

بین گزینه ۲ و ۵ کدوم یک بهتر هستن؟

هر دو از نظر استاندارد های رست درستن ولی از زاویه دید دیزاین کدوم شون بهتره؟

بستگی به شرایط داره.

@purecoder_ir

BY Pure Coder


Share with your friend now:
tgoop.com/purecoder_ir/1102

View MORE
Open in Telegram


Telegram News

Date: |

Judge Hui described Ng as inciting others to “commit a massacre” with three posts teaching people to make “toxic chlorine gas bombs,” target police stations, police quarters and the city’s metro stations. This offence was “rather serious,” the court said. Although some crypto traders have moved toward screaming as a coping mechanism, several mental health experts call this therapy a pseudoscience. The crypto community finds its way to engage in one or the other way and share its feelings with other fellow members. There have been several contributions to the group with members posting voice notes of screaming, yelling, groaning, and wailing in different rhythms and pitches. Calling out the “degenerate” community or the crypto obsessives that engage in high-risk trading, Co-founder of NFT renting protocol Rentable World emiliano.eth shared this group on his Twitter. He wrote: “hey degen, are you stressed? Just let it out all out. Voice only tg channel for screaming”. 5Telegram Channel avatar size/dimensions The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday.
from us


Telegram Pure Coder
FROM American