RESTLESS ?? REST API
Itharaju Sai Kiran
???????? ???????? ?? ??????????? | ????? | ????????? | ????????
As an Integration developer, I Dealt With, soap APIs -Soap API services, the grand-father?? of services, and REST, the cool kid?? on the block. I have been involved in multiple API projects till now —building, designing, and sometimes just scratching my head
Inconsistent schemas, weird status codes, and messy endpoints—I've seen?? it all.
So, I just wanted to write a few tips for designing REST APIs I am not a guruji????, and these tips aren't permanent??, They're just bits I have picked up from tinkering with APIs. I am not an expert at REST APIs but think of it like a dance practice that makes our dance perfect.
I would share some code snippets that might make you laugh. If they look familiar, no worries! ?? We are all learning here.
Mastering the Mysteries of REST API
REST API Overview from W3Schools
HTTP has these action words: GET, POST, PUT, PATCH, and DELETE—pretty much the Avengers?? of web actions.
Understanding HTTP CRUD Actions
HTTP CRUD actions are fundamental operations used in web development to create, read, update, and delete resources on a server. These actions correspond to the standard HTTP methods: POST, GET, PUT/PATCH, and DELETE.
1. Create (POST)
POST method operation, often associated with the HTTP POST method, adds new data to the server. When a client sends a POST request to the server, it typically includes data in the request body. This data represents the resource to be created.
2. Read (GET)
The READ operation, associated with the HTTP GET method, is used to retrieve existing data from the server. When a client sends a GET request to the server, it requests specific information or a collection of resources.
Here, the client is retrieving information about the user with the ID 123 by sending a GET request to the /users/123 endpoint.
3. Update (PUT/PATCH)
The UPDATE operation is used to modify existing data on the server. It is commonly implemented using either the HTTP PUT or PATCH methods. PUT is used to completely replace the resource, while PATCH is used to apply partial modifications.
In this example, the client is updating the email address of the user with ID 123 by sending a PATCH request to the /users/123 endpoint with the new email address.
4. Delete (DELETE)
The DELETE operation, associated with the HTTP DELETE method, is used to remove existing data from the server.
Here, the client is deleting the user with ID 123 by sending a DELETE request to the /users/123 endpoint.
领英推荐
PUT??POST.
Summary
POST and PUT are key players in web development, allowing us to create and reshape digital content with ease. They are the architects of change in the vast landscape of the internet, shaping our digital world one request at a time
We must know the HTTP Error codes 1xx Informational:
2xx Success:
3xx Redirection:
4xx Client Error:
5xx Server Error:
Best Practices for Rest API Implementation
Use HTTPS Always: It's like wrapping your API in a digital hug with SSL. Plus, it cuts down on authentication drama with fancy access tokens using HTTP Basic Auth.
Hash those Passwords: Think of it as giving your passwords a secret disguise. Hackers might try, but they won't crack it! MD5, PBKDF2, bcrypt, SHA—pick your favorite password superhero.
?
Consider OAuth: It's like adding a VIP pass to your API party. OAuth 2.0 lets third-party apps sneak in, but only with your permission!
?
Validate Inputs: Think of it as a bouncer for your API club. Validate those request parameters right at the door before they cause any mischief inside.
Contact EasyStepIn for comprehensive #ipass cloud integration solutions leveraging top-tier tools Such as Boomi Workato Celigo SnapLogic
Associate Software Engineer | React Native Developer | Android & IOS
11 个月????
Senior Integration Tech Lead at EasyStepIn
1 年Article looks too good like Jerry ??. Thanks for sharing the Content and appreciate your work and ideology ??
Boomi Integration Developer | WebServices & APIs | Queues | Event/Batch (ETL) and Real Time Scenario's | XML JSON CSV IDOC EDI EDM YAML SOAPUI POSTMAN
1 年Very interactive and infotainment learning way.. Itharaju Sai Kiran. would like to read more such topics :)
Senior Software Engineer at Wipro
1 年Article looks very interesting and easy to understand. Great job Itharaju Sai Kiran