Utility Classes

jsonRequest Method

To Make an HTTP request to a REST Service

Parameters

ParametersDescription
baseUrithe base URI that request will be made
resourcethe resource requested by server
typeReferencethe response type of HTTP response will be mapped
urlParamMapURL parameters passed through URI (e.g. /api/car/{brand} => /api/car/BMW)
queryParamMapURL parameters passed as query params (e.g. /api/car?brand=BMW)
httpMethodtype of HTTP request (GET, POST, etc.)
headerParamMapthe extra fields that could be passed through header
restTemplatethe Spring RestTemplate instance to make http requests

Returns HTTP response returned by endpoint

Example Usage