Class HttpAccessTransport

java.lang.Object
fr.paris.lutece.plugins.librarynotifygru.rs.service.HttpAccessTransport
All Implemented Interfaces:
IHttpTransportProvider

public class HttpAccessTransport extends Object implements IHttpTransportProvider
IHttpTransportProvider which use library-httpaccess
  • 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:
      doPost in interface IHttpTransportProvider
      Parameters:
      strUrl - url to call
      mapParams - params to post
      mapHeadersRequest - 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:
      doPostJSON in interface IHttpTransportProvider
      Type Parameters:
      T - of the response
      Parameters:
      strUrl - url to call
      mapParams - params to post
      mapHeadersRequest - headers of the request
      json - JSON object to post
      responseJsonClass - the class
      mapper - mapper for JSON serialize / deserialize
      Returns:
      response