Class HttpLoader

java.lang.Object
no.hasmac.jsonld.loader.HttpLoader
All Implemented Interfaces:
DocumentLoader

public class HttpLoader extends Object
  • Field Details

  • Constructor Details

    • HttpLoader

      @Deprecated(since="1.0.3") public HttpLoader(HttpClient httpClient)
      Deprecated.
      use HttpLoader(no.hasmac.jsonld.http.HttpClient httpClient)
      Parameters:
      httpClient -
    • HttpLoader

      @Deprecated(since="1.0.3") public HttpLoader(HttpClient httpClient, int maxRedirections)
      Deprecated.
      use HttpLoader(no.hasmac.jsonld.http.HttpClient httpClient, int maxRedirection)
      Parameters:
      httpClient -
      maxRedirections -
    • HttpLoader

      public HttpLoader(HttpClient httpClient)
    • HttpLoader

      public HttpLoader(HttpClient httpClient, int maxRedirections)
  • Method Details

    • defaultInstance

      public static DocumentLoader defaultInstance()
    • loadDocument

      public Document loadDocument(URI uri, DocumentLoaderOptions options) throws JsonLdError
      Description copied from interface: DocumentLoader
      Retrieve a remote document.
      Specified by:
      loadDocument in interface DocumentLoader
      Parameters:
      uri - of the remote document to fetch
      options - to set the behavior of the loader
      Returns:
      Document representing a remote document
      Throws:
      JsonLdError
    • getAcceptHeader

      public static String getAcceptHeader()
    • getAcceptHeader

      public static String getAcceptHeader(Collection<String> profiles)
    • setFallbackContentType

      public void setFallbackContentType(MediaType fallbackContentType)
      Set fallback content-type used when received content-type is not supported. e.g. setFallbackContentType(MediaType.JSON_LD)
      Parameters:
      fallbackContentType - a content type that overrides unsupported received content-type