The best practice for passing an ID parameter in an API depends on the specific use case and conventions. Here are some general guidelines: 1. Passing ID in the URL: This is the most common and widely accepted practice, especially for retrieving a specific resource or performing actions on a resource. For example, if you're fetching information about a user with ID 123, the URL might look like: /users/123. It's simple, RESTful, and follows standard conventions. 2. Passing ID as Form Data: This is generally used when you need to create or update a resource. In such cases, the ID might be part of the request body, and not in the URL. However, this is less common for retrieving data, and it might not align with RESTful principles. In summary, if you're performing actions related to a resource or retrieving a specific resource, passing the ID in the URL is a more conventional and RESTful approach. If you're creating or updating a resource, you can include the ID in the request body as form data. Always document your API's conventions and follow industry best practices to ensure consistency and clarity.
Perhaps you are trying to send a request with a request method that is not allowed. Based on what request methods were specified for that endpoint in your code
I've been away with Django for almost 3 years, nice refresher thank you brother for putting this up.
I am glad I could help!🥳🥳
You have explained this beautifully . Keep up the good work!
Thank you so much 🎉🎉
Greate job sir. i learned a lot with this video. thank you very much!!!
I am glad I could help 🥳🥳🥳
What tut realy like you have explained it beautifully
Glad I could help 🎉🎉
Hello, we want a full course API rest framework ( backEnd )
( a complete project with the addition of pictures, tokens and everything)
Okay
Pls what’s the name of the extension you installed on vs code that was suggesting code
It’s called tabnine
@@the_proton_guy thanks 🙏
Is it recommended to pass in id in a form-data or as a url parameter like delete-post/id ?
The best practice for passing an ID parameter in an API depends on the specific use case and conventions. Here are some general guidelines:
1. Passing ID in the URL: This is the most common and widely accepted practice, especially for retrieving a specific resource or performing actions on a resource. For example, if you're fetching information about a user with ID 123, the URL might look like: /users/123. It's simple, RESTful, and follows standard conventions.
2. Passing ID as Form Data: This is generally used when you need to create or update a resource. In such cases, the ID might be part of the request body, and not in the URL. However, this is less common for retrieving data, and it might not align with RESTful principles.
In summary, if you're performing actions related to a resource or retrieving a specific resource, passing the ID in the URL is a more conventional and RESTful approach. If you're creating or updating a resource, you can include the ID in the request body as form data. Always document your API's conventions and follow industry best practices to ensure consistency and clarity.
@@the_proton_guy okay, thanks
my code has an error the method is not allowed, why?
Perhaps you are trying to send a request with a request method that is not allowed. Based on what request methods were specified for that endpoint in your code
Well done sir. I have a question please. Is it compulsory that frontend frameworks like React, Angular and Vue be used when using DRF?
Thanks
No, it's not compulsory. Although it depends on what kind of app you are trying to build.
Thanks!
You are welcome🎉
Nice thank you so much , like 👍 and subscribed
Thank you!
Very helpful 👏
Very informative! Thank youu
You are welcome 🥳
well explained 💯💯✌️
Thank you 🥳
@@the_proton_guy boss do you a community I would love to join
@Theblueprint212 unfortunately, no. Although I have been thinking about creating one
@@the_proton_guy please when you do. Do well to notify me please I would love to join. I like how u teach
@Theblueprint212 thank you! I just created a telegram group for that purpose. You can join using the link below:
t.me/+sO6ZFOaiaMszYzI0
it's so goog
Thank you
Lovely bro
Thank you 🥳