-
Notifications
You must be signed in to change notification settings - Fork 0
Developer deep dive into Http API
One of the key enablers of the faster, lighter, cheaper approach behind this MIS over the existing version of mifos is the API.
Heres an overview of what its based on:
- The API is resource-oriented. Whilst not what some would view as full REST, it is a pragmatic approach.
- Its developer-oriented. The purpose of the API is to make the developer that uses it successful and productive.
- As such the API should be predictable and simple to learn and use
We can achieve this through:
- Resource URLs will be simple and intuitive
- JSON will be returned in all responses from the API, including errors
|Resource|POST (create)|GET(read)|PUT(update)|DELETE(delete)| |/loanproducts| create new loanproduct| list all loanproducts | bulk update loan products | delete all loan products |
In mifosx we use Jersey and its support for integration with spring. see https://wikis.oracle.com/display/Jersey/Main
In the mifosngprovider/src/main/webapp/WEB-INF/web.xml
you will see configuration for a servlet named jersey-serlvet
that is mapped to /api/*
. This allows for all requests that begin with /api
to be routed through Jersey e.g. https://localhost:8085/mifosng-provider/api/v1/loanproducts
The support for com.sun.jersey.spi.spring.container.servlet.SpringServlet
class used comes from Jerseys spring-integration project. See mifosngprovider/build.gradle
for the dependencies.