Class HttpLoader
java.lang.Object
no.hasmac.jsonld.loader.HttpLoader
- All Implemented Interfaces:
DocumentLoader
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpLoader(HttpClient httpClient) Deprecated.HttpLoader(HttpClient httpClient, int maxRedirections) Deprecated.useHttpLoader(no.hasmac.jsonld.http.HttpClient httpClient, int maxRedirection)HttpLoader(HttpClient httpClient) HttpLoader(HttpClient httpClient, int maxRedirections) -
Method Summary
Modifier and TypeMethodDescriptionstatic DocumentLoaderstatic Stringstatic StringgetAcceptHeader(Collection<String> profiles) loadDocument(URI uri, DocumentLoaderOptions options) Retrieve a remote document.voidsetFallbackContentType(MediaType fallbackContentType) Set fallback content-type used when received content-type is not supported. e.g.
-
Field Details
-
MAX_REDIRECTIONS
public static final int MAX_REDIRECTIONS- See Also:
-
-
Constructor Details
-
HttpLoader
Deprecated.useHttpLoader(no.hasmac.jsonld.http.HttpClient httpClient)- Parameters:
httpClient-
-
HttpLoader
Deprecated.useHttpLoader(no.hasmac.jsonld.http.HttpClient httpClient, int maxRedirection)- Parameters:
httpClient-maxRedirections-
-
HttpLoader
-
HttpLoader
-
-
Method Details
-
defaultInstance
-
loadDocument
Description copied from interface:DocumentLoaderRetrieve a remote document.- Specified by:
loadDocumentin interfaceDocumentLoader- Parameters:
uri- of the remote document to fetchoptions- to set the behavior of the loader- Returns:
Documentrepresenting a remote document- Throws:
JsonLdError
-
getAcceptHeader
-
getAcceptHeader
-
setFallbackContentType
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
-
HttpLoader(no.hasmac.jsonld.http.HttpClient httpClient)