Posts

Rest API Design and Best Practices

The most important part while building any rest api is the api design i.e. URL. Here are the best practices while designing any rest api. 1.  Segregate the apis into logical resources:               In Rest, the primary data representation entity is called resource .  The key principle of rest  involve separating your api into logical resources.                Example: For an e-commerce website, the possible resources can be orders, customers, vendors etc.  2. Resource names should be a noun (not verb):                   RESTful URIs should refer to a resource that is a thing ( noun ) instead of referring to an action (verb) because nouns have properties which verbs do not have – similar to resources have attributes.                   Example: /employees, /orders, /students, /posts etc. in...