Today we will see how we can call Rest API in Liferay by using Spring RestTemplate. We just need to add dependencies related to Spring and accordingly write our client.
So lets start this step by step :-
Step 1:- Add Dependencies
Just open your build.gradle file and add two dependencies related to gradle.
build.gradle
Step 2:- Use RestTemplte to write the client
In your java class you can use RestTemplate Class to call various APIs . Here i am using one open source rest api that will give us country details.
CountryImpl.java
Related Post:-
No comments:
Post a Comment