webjs-tech / personal-development-plan

This repository helps to cover tech gaps
2 stars 0 forks source link

API Design #43

Open Security2431 opened 11 months ago

Security2431 commented 11 months ago

Good to know:

TODO:

Additional Information:

Image

Image

Image

Security2431 commented 9 months ago

Image

Security2431 commented 8 months ago

Image

Security2431 commented 7 months ago

๐—›๐—ผ๐˜„ ๐—ฑ๐—ผ ๐—›๐—ง๐—ง๐—ฃ ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€ ๐—ฐ๐—ผ๐—ฑ๐—ฒ๐˜€ ๐˜„๐—ผ๐—ฟ๐—ธ, ๐—ฎ๐—ป๐—ฑ ๐˜„๐—ต๐—ถ๐—ฐ๐—ต ๐—ฎ๐—ฟ๐—ฒ ๐—บ๐—ผ๐˜€๐˜ ๐—ถ๐—บ๐—ฝ๐—ผ๐—ฟ๐˜๐—ฎ๐—ป๐˜?

When a server receives a request from a client, it provides a response that includes both the requested data and a 3-digit ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€ ๐—ฐ๐—ผ๐—ฑ๐—ฒ that succinctly ๐—ฐ๐—ผ๐—บ๐—บ๐˜‚๐—ป๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€ ๐˜๐—ต๐—ฒ ๐—ฟ๐—ฒ๐—พ๐˜‚๐—ฒ๐˜€๐˜'๐˜€ ๐—ผ๐˜‚๐˜๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ผ๐—ฟ ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€.

Clients use these standardized sets of codes to determine if a request has been properly handled, whether more action is required, or whether an error has occurred.

HTTP status codes are ๐—ฑ๐—ถ๐˜ƒ๐—ถ๐—ฑ๐—ฒ๐—ฑ ๐—ถ๐—ป๐˜๐—ผ ๐—ณ๐—ถ๐˜ƒ๐—ฒ ๐—ฐ๐—ฎ๐˜๐—ฒ๐—ด๐—ผ๐—ฟ๐—ถ๐—ฒ๐˜€, each ๐—ถ๐—ฑ๐—ฒ๐—ป๐˜๐—ถ๐—ณ๐—ถ๐—ฒ๐—ฑ ๐—ฏ๐˜† ๐˜๐—ต๐—ฒ ๐—ณ๐—ถ๐—ฟ๐˜€๐˜ ๐—ฑ๐—ถ๐—ด๐—ถ๐˜ ๐—ผ๐—ณ ๐˜๐—ต๐—ฒ ๐—ฐ๐—ผ๐—ฑ๐—ฒ:

๐ŸŸฃ ๐—œ๐—ป๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น (๐Ÿญ๐˜…๐˜…): The request was received, and the process is continuing. ๐ŸŸข ๐—ฆ๐˜‚๐—ฐ๐—ฐ๐—ฒ๐˜€๐˜€ (๐Ÿฎ๐˜…๐˜…): The request was successfully received, understood, and accepted. ๐Ÿ”ต ๐—ฅ๐—ฒ๐—ฑ๐—ถ๐—ฟ๐—ฒ๐—ฐ๐˜๐—ถ๐—ผ๐—ป (๐Ÿฏ๐˜…๐˜…): The request needs further action to be completed. ๐ŸŸ  ๐—–๐—น๐—ถ๐—ฒ๐—ป๐˜ ๐—ฒ๐—ฟ๐—ฟ๐—ผ๐—ฟ (๐Ÿฐ๐˜…๐˜…): The request contains incorrect syntax or cannot be fulfilled by the server. ๐Ÿ”ด ๐—ฆ๐—ฒ๐—ฟ๐˜ƒ๐—ฒ๐—ฟ ๐—ฒ๐—ฟ๐—ฟ๐—ผ๐—ฟ (๐Ÿฑ๐˜…๐˜…): The server failed to fulfil a valid request.

You can learn more about status codes here: https://lnkd.in/gDq8fMDt

๐—ง๐—ต๐—ฒ ๐—บ๐—ผ๐˜€๐˜ ๐—ถ๐—บ๐—ฝ๐—ผ๐—ฟ๐˜๐—ฎ๐—ป๐˜/๐—ฐ๐—ผ๐—บ๐—บ๐—ผ๐—ป ๐—ณ๐—ผ๐—ฟ ๐—ฒ๐—ฎ๐—ฐ๐—ต ๐—ฐ๐—ฎ๐˜๐—ฒ๐—ด๐—ผ๐—ฟ๐˜† ๐—ฎ๐—ฟ๐—ฒ ๐—น๐—ถ๐˜€๐˜๐—ฒ๐—ฑ ๐—ถ๐—ป ๐˜๐—ต๐—ฒ ๐˜ƒ๐—ถ๐˜€๐˜‚๐—ฎ๐—น ๐—ฏ๐—ฒ๐—น๐—ผ๐˜„.

Server ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€ ๐—ฐ๐—ผ๐—ฑ๐—ฒ๐˜€ for HTTP ๐˜€๐—ฒ๐—ฟ๐˜ƒ๐—ฒ ๐˜€๐—ฒ๐˜ƒ๐—ฒ๐—ฟ๐—ฎ๐—น ๐—ธ๐—ฒ๐˜† ๐—ณ๐˜‚๐—ป๐—ฐ๐˜๐—ถ๐—ผ๐—ป๐˜€ in web development including:

๐Ÿ”ธ Efficient communication ๐Ÿ”ธ Reliability and troubleshooting ๐Ÿ”ธ Error identification ๐Ÿ”ธ Facilitating automation ๐Ÿ”ธ Providing user feedback ๐Ÿ”ธ And much moreโ€ฆ

Below are some ๐—ฏ๐—ฒ๐˜€๐˜ ๐—ฝ๐—ฟ๐—ฎ๐—ฐ๐˜๐—ถ๐—ฐ๐—ฒ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐˜„๐—ผ๐—ฟ๐—ธ๐—ถ๐—ป๐—ด ๐˜„๐—ถ๐˜๐—ต ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€ ๐—ฐ๐—ผ๐—ฑ๐—ฒ๐˜€:

๐Ÿ”น ๐—จ๐˜€๐—ฒ ๐˜€๐—ฝ๐—ฒ๐—ฐ๐—ถ๐—ณ๐—ถ๐—ฐ ๐˜€๐˜๐—ฎ๐˜๐˜‚๐˜€ ๐—ฐ๐—ผ๐—ฑ๐—ฒ๐˜€: Use the most specific status code that accurately describes the outcome of an operation. ๐Ÿ”น ๐—•๐—ฒ ๐—ฐ๐—ผ๐—ป๐˜€๐—ถ๐˜€๐˜๐—ฒ๐—ป๐˜: Maintain consistency in how you use status codes across your application. ๐Ÿ”น ๐—œ๐—บ๐—ฝ๐—น๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ฐ๐˜‚๐˜€๐˜๐—ผ๐—บ ๐—ฒ๐—ฟ๐—ฟ๐—ผ๐—ฟ ๐—บ๐—ฒ๐˜€๐˜€๐—ฎ๐—ด๐—ฒ๐˜€: Send additional info in the response body or headers to provide more context. ๐Ÿ”น ๐—Ÿ๐—ผ๐—ด ๐—ฎ๐—ป๐—ฑ ๐—บ๐—ผ๐—ป๐—ถ๐˜๐—ผ๐—ฟ: Logging and monitoring of the status codes your app is sending and receiving can help in performance tuning, detecting anomalies, and debugging.

Although HTTP status codes may seem like a small and simple aspect of web development, they play an indispensable role in client, server communication. Understanding and utilizing the status codes effectively is a fundamental part of developing sound applications.

~~ A big thank you to our partner Kickresume who keeps our content free to the community.

๐Ÿ“„ Build a winning resume (without spending all day). Kickresume has templates used by people hired at Google, Microsoft, and more (industry-specific & ATS-friendly).

Image