Class HttpAccessTransport
java.lang.Object
fr.paris.lutece.plugins.librarynotifygru.rs.service.HttpAccessTransport
- All Implemented Interfaces:
IHttpTransportProvider
IHttpTransportProvider which use library-httpaccess
-
Field Summary
Fields inherited from interface fr.paris.lutece.plugins.librarynotifygru.rs.service.IHttpTransportProvider
HTTP_HEADER_ACCEPT, HTTP_HEADER_AUTHORIZATION, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_MEDIATYPE_APPLICATION_FORM_URLENCODED, HTTP_HEADER_MEDIATYPE_APPLICATION_JSON, HTTP_HEADER_MEDIATYPE_APPLICATION_JSON_UTF8 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmake POST request on given url with params and headers<T> TdoPostJSON(String strUrl, Map<String, String> mapParams, Map<String, String> mapHeadersRequest, Object json, Class<T> responseJsonClass, com.fasterxml.jackson.databind.ObjectMapper mapper) make POST request on given url with params and headers of a JSON object to retrieve another JSON
-
Constructor Details
-
HttpAccessTransport
public HttpAccessTransport()
-
-
Method Details
-
doPost
public String doPost(String strUrl, Map<String, String> mapParams, Map<String, String> mapHeadersRequest) make POST request on given url with params and headers- Specified by:
doPostin interfaceIHttpTransportProvider- Parameters:
strUrl- url to callmapParams- params to postmapHeadersRequest- headers of the request- Returns:
- response body as String
-
doPostJSON
public <T> T doPostJSON(String strUrl, Map<String, String> mapParams, Map<String, String> mapHeadersRequest, Object json, Class<T> responseJsonClass, com.fasterxml.jackson.databind.ObjectMapper mapper) make POST request on given url with params and headers of a JSON object to retrieve another JSON- Specified by:
doPostJSONin interfaceIHttpTransportProvider- Type Parameters:
T- of the response- Parameters:
strUrl- url to callmapParams- params to postmapHeadersRequest- headers of the requestjson- JSON object to postresponseJsonClass- the classmapper- mapper for JSON serialize / deserialize- Returns:
response
-