Tag: resttemplate
-
How to call REST API protected with SSL (https) from Spring Boot ?
Let’s say you want to invoke a REST API from your spring boot application. And it is protected with SSL. In other words you need an SSL certificate to access that application, else you won’t be given access to it. Your java keystore already has a lot of inbuilt certificates(In my local it is present…
-
How to pass URL and query parameters in Spring REST client?
Let’s say you are making a GET request to a third party API from your spring application. You want to pass both URL and query parameters. First, what are URL and query parameters? URL parameters: URL parameters are passed along with the URL like this: https://thirdpartyapi.com/request/1 In the above request , let’s assume the number…
-
How to set read time out for calling REST services using Spring REST template ?
Let’s say you are invoking a REST service using Spring’s REST template. And you want to set the read time out to a certain value. You don’t want the invoked service to take too much time to send data. You can do this in two ways: Set the time out locally Set the time out…
-
How to consume a REST service which accepts form data in Spring?
Let’s say you want to consume a REST service from your Spring Boot / Spring MVC application. The developer who created the REST service you wanted to consume, developed it in such a way that it accepts only form data. May be he created it to accept data from HTML forms. And now you want…