REST API Headers vs Path Parameters vs Query Parameters vs Body
HTML-код
- Опубликовано: 24 янв 2023
- A discussion on the purpose and proper usage of HTTP Headers, Path Parameters, Query Parameters and Request Body when developing a REST API
Clean URLs: en.wikipedia.org/wiki/Clean_URL
Authorization Header: developer.mozilla.org/en-US/d...
#restapi #http #programming #headers #api #development #technical #softwarearchitecture #softwaredevelopment #softwareengineering Наука
excellent explanation ,well done
it was really quite precise and much informative.
Glad that you found it informative. Thank you!
You're doing a great job man. Thank you.
I appreciate that!
Thank you for breaking out this information and best practices!
Glad that you found the video useful.
Straightforward and simple. Thank you.
I learn so much from this. Well done. 🙏
Thank you, I’m glad that you found this video useful.
I'm new to APIs and have been struggling to understand the difference between headers, body, path. Very helpful. Thank you.
I am glad that you found this video helpful. Thank you.
Great explanation with examples 👏
Thank you and I appreciate the feedback.
Precise and straight to the point
Thank you!
Superb!!!!
Thanks a lot
amazingggg
Thanks!
Thanks for the intro. But I was wondering, why don’t just use a post request with the body in every case? That way it could make the code more simple no?
Short answer is that you can use a POST request for every case. If you are writing a HTTP/REST API and you will be calling that API from another application of yours then you can use POST request for everything.
However, there are norms, conventions, best practices that people like to follow because it isn’t always just you working alone. When you are working for an employer with many other programmers, there will always be atleast one programmer who will question you for not following the conventions. For example, when an API’s job is to only return data and you decide to use POST method in your API instead of GET then others may ask you to justify why you used POST since it a general understanding that GET method is for data retrieval and POST request are used to change the state of the data on the server.
Hope this answers your question.
how come GET request cant have body?
I don't think I've said anything like that in the video, have I?
I'll double check the video. You are correct, GET request shouldn't have a request body