Errors should not be just plain message sent in response. There is a whole standard for errors and it's called Problem Details (RFC 7807). That's the right way of building a good web API.
@gkcs Жыл бұрын
Excellent points, thank you!
@S3Kglitches Жыл бұрын
Idempotency does not apply to all API requests. The HTTP protocol explicitly defines which HTTP verbs should be idempotent. For example POST is not idempotent. It will simply insert another entity when repeated.
@arunraju9705 Жыл бұрын
Keep going man. good stuff!
@AamirKhan-gv8oh Жыл бұрын
@S3K what do you suggest to follow for REST best practices
@S3Kglitches Жыл бұрын
@AamirKhan-gv8oh Read the REST definition paper or its brief summary and read the relevant HTTP standards (RFC) in latest version for each used part of the protocol. Do not aim for REST API maturity level 3 but try reaching REST API maturity level 2.
@S3Kglitches Жыл бұрын
"You can access APIs using REST or GraphQL" = wrong. You access *web* APIs using HTTP protocol. REST is only about structuring API and adding semantics to the endpoints.
@olafthebadlynamed2373 Жыл бұрын
Where are you quoting this from? He said expose, not access.
@Maruth7 ай бұрын
In way than also wrong, you reach api server with TCP/IP Portcol
@sarankumar_n Жыл бұрын
6:42 I also faced that status code problem 😅. I receive status code as 200 but in response they have field called status which value is failed 😒.
@S3Kglitches Жыл бұрын
APIs are not just web APIs of which you are talking but for example Win32 API to communicate with the operating system. API is not Web API.
@forbiddensouls Жыл бұрын
are there any tools or libraries we can refer to, in order to handle atomicity well? For instance, If during an API execution I am performing a couple of operations and one tends to break, then at times its kinda hard to revert the other partially committed operations. function myFullOperation(){ // first partial operation - Writes something in DB or updates const myminorOperation = new Promise() // same as previous one const mysecondMinorOperation = new Promise() // this one fails const thisOperationFails = new Promise() } We can definitely manually write the logic to handle these operations, but that would be a nightmare when writing complex logics and your app tends to scale. So is there any tidier way to handle this?
@ShubhamVarshney-o7c Жыл бұрын
There are two response codes generally. 1 API response code, 2. Operation response. They both might be HTTP Status Codes
@afsanVlog1100 Жыл бұрын
please increase video quality it can be more than 1080 p and I am pretty sure you will consider , watching on big screen need good quality of video Thanks
@atharva1237 Жыл бұрын
This has been usch a big problem when I was using Third Party GST apis they are just shit! They give response 200 with error message very frustrating. Very good video.
@smrutiranjansahoo1308 Жыл бұрын
@gkcs when you're saying add api should be idempotency, what if clients wants to add multiple times on the given id ?? In that case it won't be. Right??
@sandipbhaumik Жыл бұрын
I have a query about api atomicity. Let's say I have a bulk operation In database and the process gets failed in between. Is it okay to skip that erroneous data and continue till end? If we maintain the atomicity, then I have to rollback all transaction due single or few data which are faulty. What's your opinion on this?
@pankaj_9998 Жыл бұрын
Idempotent - How do server knows that the request add (10rs, id- 50) is already done? If the client is making the request for the second time ??
@prabhussingh Жыл бұрын
Really insightful 💡
@thePradiptalks Жыл бұрын
Hey Gaurav, You mentioned about the aadhar data being transferred over wire. Can you explain more about good that works and how it should actually be transferred?
@dalbeersingh1788 Жыл бұрын
This is a great video!
@mohammedsameermohiuddin1121 Жыл бұрын
User not found is not an error. And status code indicate the api is successfully completed. I think 200 sc is correct we always check if error exists in the response
@gkcs Жыл бұрын
When designing APIs, think of the client (people calling the API) instead of the server (engineers handling the requests). It is likely that the sender expected to read or write data in the system. They won't consider a "UserNotFound" response as part of their normal/happy flow. Hence it is more intuitive to return an error code in the response along with the description/prescription. Does this make sense? Let me know if you have further doubts on this.
@sachinjuneja24055 ай бұрын
GKCS fullform?
@PriyanshuPrasadGupta Жыл бұрын
nice ❤❤❤❤
@RajaSekharaReddyKaluri Жыл бұрын
@gkcs can you share a intermediate level python API (flask or fastapi) which has all the best practices followed? I want to use it as a template for any new development around apis
@Chesstreamer Жыл бұрын
Bro made an entire video to teach those Adhaar engineers how to send right api response code🤣
@gkcs Жыл бұрын
It wasn't the Aadhaar folks, it was a third party😅 But yes, I made a video out of it :p
@cristinareese8444 Жыл бұрын
😝 Promo sm
@mrrishiraj88 Жыл бұрын
👍💯🙏
@KheraShanu Жыл бұрын
Came here to comment, but apparently S3Kglitches took away all my comments and more ... kudos to You @S3Kglitches
@gkcs Жыл бұрын
It's folks like @S3Kglitches who make this an awesome place.