Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Waher.Content.InternetContent Class Reference

Static class managing encoding and decoding of internet content. More...

Static Public Member Functions

static bool Encodes (object Object, out Grade Grade, out IContentEncoder Encoder, params string[] AcceptedContentTypes)
 If a given object can be encoded. More...
 
static byte[] Encode (object Object, Encoding Encoding, out string ContentType, params string[] AcceptedContentTypes)
 Encodes an object. More...
 
static Task< KeyValuePair< byte[], string > > EncodeAsync (object Object, Encoding Encoding, params string[] AcceptedContentTypes)
 Encodes an object. More...
 
static bool IsAccepted (string ContentType, params string[] AcceptedContentTypes)
 Checks if a given content type is acceptable. More...
 
static bool IsAccepted (string[] ContentTypes, params string[] AcceptedContentTypes)
 Checks if at least one content type in a set of content types is acceptable. More...
 
static bool IsAccepted (string[] ContentTypes, out string ContentType, params string[] AcceptedContentTypes)
 Checks if at least one content type in a set of content types is acceptable. More...
 
static bool Decodes (string ContentType, out Grade Grade, out IContentDecoder Decoder)
 If an object with a given content type can be decoded. More...
 
static object Decode (string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri)
 Decodes an object. More...
 
static Task< object > DecodeAsync (string ContentType, byte[] Data, Encoding Encoding, KeyValuePair< string, string >[] Fields, Uri BaseUri)
 Decodes an object. More...
 
static object Decode (string ContentType, byte[] Data, Uri BaseUri)
 Decodes an object. More...
 
static Task< object > DecodeAsync (string ContentType, byte[] Data, Uri BaseUri)
 Decodes an object. More...
 
static Encoding GetEncoding (string CharacterSet)
 Gets a character encoding from its name. More...
 
static string GetContentType (string FileExtension)
 Gets the content type of an item, given its file extension. It uses the TryGetContentType to see if any of the content encoders/decoders support content with the corresponding file type. If no such encoder/decoder is found, the generic application/octet-stream type is returned. More...
 
static bool TryGetContentType (string FileExtension, out string ContentType)
 Tries to get the content type of an item, given its file extension. More...
 
static string GetFileExtension (string ContentType)
 Gets the file extension of an item, given its content type. It uses the TryGetFileExtension to see if any of the content encoders/decoders support content with the corresponding content type. If no such encoder/decoder is found, the generic bin extension is returned. More...
 
static bool TryGetFileExtension (string ContentType, out string FileExtension)
 Tries to get the file extension of an item, given its content type. More...
 
static bool CanConvert (string FromContentType, string ToContentType, out IContentConverter Converter)
 Checks if it is possible to convert content from one type to another. More...
 
static IContentConverter[] GetConverters (string FromContentType)
 Gets available converters that can convert content from a given type. More...
 
static bool CanGet (Uri Uri, out Grade Grade, out IContentGetter Getter)
 If a resource can be gotten, given its URI. More...
 
static Task< object > GetAsync (Uri Uri, params KeyValuePair< string, string >[] Headers)
 Gets a resource, given its URI. More...
 
static Task< object > GetAsync (Uri Uri, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Gets a resource, given its URI. More...
 
static Task< object > GetAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Gets a resource, given its URI. More...
 
static Task< object > GetAsync (Uri Uri, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Gets a resource, given its URI. More...
 
static Task< object > GetAsync (Uri Uri, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Gets a resource, given its URI. More...
 
static Task< object > GetAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Gets a resource, given its URI. More...
 
static Task< KeyValuePair< string, TemporaryStream > > GetTempStreamAsync (Uri Uri, params KeyValuePair< string, string >[] Headers)
 Gets a (possibly big) resource, given its URI. More...
 
static Task< KeyValuePair< string, TemporaryStream > > GetTempStreamAsync (Uri Uri, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Gets a (possibly big) resource, given its URI. More...
 
static Task< KeyValuePair< string, TemporaryStream > > GetTempStreamAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Gets a (possibly big) resource, given its URI. More...
 
static Task< KeyValuePair< string, TemporaryStream > > GetTempStreamAsync (Uri Uri, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Gets a (possibly big) resource, given its URI. More...
 
static Task< KeyValuePair< string, TemporaryStream > > GetTempStreamAsync (Uri Uri, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Gets a (possibly big) resource, given its URI. More...
 
static Task< KeyValuePair< string, TemporaryStream > > GetTempStreamAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Gets a (possibly big) resource, given its URI. More...
 
static bool CanPost (Uri Uri, out Grade Grade, out IContentPoster Poster)
 If a resource can be posted to, given its URI. More...
 
static Task< object > PostAsync (Uri Uri, object Data, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PostAsync (Uri Uri, object Data, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PostAsync (Uri Uri, object Data, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PostAsync (Uri Uri, object Data, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PostAsync (Uri Uri, object Data, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PostAsync (Uri Uri, object Data, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PostAsync (Uri Uri, byte[] EncodedData, string ContentType, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PostAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PostAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PostAsync (Uri Uri, byte[] EncodedData, string ContentType, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PostAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PostAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Posts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static bool CanPut (Uri Uri, out Grade Grade, out IContentPutter Putter)
 If a resource can be putted to, given its URI. More...
 
static Task< object > PutAsync (Uri Uri, object Data, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PutAsync (Uri Uri, object Data, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PutAsync (Uri Uri, object Data, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PutAsync (Uri Uri, object Data, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PutAsync (Uri Uri, object Data, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > PutAsync (Uri Uri, object Data, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PutAsync (Uri Uri, byte[] EncodedData, string ContentType, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PutAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PutAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PutAsync (Uri Uri, byte[] EncodedData, string ContentType, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PutAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< KeyValuePair< byte[], string > > PutAsync (Uri Uri, byte[] EncodedData, string ContentType, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Puts to a resource, using a Uniform Resource Identifier (or Locator). More...
 
static bool CanDelete (Uri Uri, out Grade Grade, out IContentDeleter Deleter)
 If a resource can be deleted to, given its URI. More...
 
static Task< object > DeleteAsync (Uri Uri, params KeyValuePair< string, string >[] Headers)
 Deletes a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > DeleteAsync (Uri Uri, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Deletes a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > DeleteAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Deletes a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > DeleteAsync (Uri Uri, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Deletes a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > DeleteAsync (Uri Uri, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Deletes a resource, using a Uniform Resource Identifier (or Locator). More...
 
static Task< object > DeleteAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Deletes a resource, using a Uniform Resource Identifier (or Locator). More...
 
static bool CanHead (Uri Uri, out Grade Grade, out IContentHeader Header)
 If the headers of a resource can be gotten, given its URI. More...
 
static Task< object > HeadAsync (Uri Uri, params KeyValuePair< string, string >[] Headers)
 Heads a resource, given its URI. More...
 
static Task< object > HeadAsync (Uri Uri, X509Certificate Certificate, params KeyValuePair< string, string >[] Headers)
 Heads a resource, given its URI. More...
 
static Task< object > HeadAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, params KeyValuePair< string, string >[] Headers)
 Heads a resource, given its URI. More...
 
static Task< object > HeadAsync (Uri Uri, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Heads a resource, given its URI. More...
 
static Task< object > HeadAsync (Uri Uri, X509Certificate Certificate, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Heads a resource, given its URI. More...
 
static Task< object > HeadAsync (Uri Uri, X509Certificate Certificate, RemoteCertificateEventHandler RemoteCertificateValidator, int TimeoutMs, params KeyValuePair< string, string >[] Headers)
 Heads a resource, given its URI. More...
 

Static Public Attributes

static readonly Encoding ISO_8859_1 = Encoding.GetEncoding("ISO-8859-1")
 ISO-8859-1 character encoding. More...
 

Properties

static string[] CanEncodeContentTypes [get]
 Internet content types that can be encoded. More...
 
static string[] CanEncodeFileExtensions [get]
 File extensions that can be encoded. More...
 
static IContentEncoder[] Encoders [get]
 Available Internet Content Encoders. More...
 
static string[] CanDecodeContentTypes [get]
 Internet content types that can be decoded. More...
 
static string[] CanDecodeFileExtensions [get]
 File extensions that can be decoded. More...
 
static IContentDecoder[] Decoders [get]
 Available Internet Content Decoders. More...
 
static IContentConverter[] Converters [get]
 Available Internet Content Converters. More...
 
static string[] CanGetUriSchemes [get]
 Internet URI Schemes that can be gotten. More...
 
static IContentGetter[] Getters [get]
 Available Internet Content Getters. More...
 
static string[] CanPostToUriSchemes [get]
 Internet URI Schemes that can be posted to. More...
 
static IContentPoster[] Posters [get]
 Available Internet Content Posters. More...
 
static string[] CanPutToUriSchemes [get]
 Internet URI Schemes that can be putted to. More...
 
static IContentPutter[] Putters [get]
 Available Internet Content Putters. More...
 
static string[] CanDeleteToUriSchemes [get]
 Internet URI Schemes that can be deleted to. More...
 
static IContentDeleter[] Deleters [get]
 Available Internet Content Deleters. More...
 
static string[] CanHeadUriSchemes [get]
 Internet URI Schemes where it is possible to get headers. More...
 
static IContentHeader[] Headers [get]
 Available Internet Content Header-retrievers. More...
 

Detailed Description

Static class managing encoding and decoding of internet content.

Definition at line 16 of file InternetContent.cs.

Member Function Documentation

◆ CanConvert()

static bool Waher.Content.InternetContent.CanConvert ( string  FromContentType,
string  ToContentType,
out IContentConverter  Converter 
)
static

Checks if it is possible to convert content from one type to another.

A shortest path algorithm maximizing conversion quality and shortening conversion distance is used to find sequences of converters, if a direct conversion is not possible.

Parameters
FromContentTypeExisting content type.
ToContentTypeDesired content type.
ConverterConverter that transforms content from type FromContentType to type ToContentType .
Returns
If a converter was found.

Definition at line 797 of file InternetContent.cs.

◆ CanDelete()

static bool Waher.Content.InternetContent.CanDelete ( Uri  Uri,
out Grade  Grade,
out IContentDeleter  Deleter 
)
static

If a resource can be deleted to, given its URI.

Parameters
UriURI of resource.
GradeHow well the deleted can delete to the resource.
DeleterBest deleter for the URI.
Returns
If a resource with the given URI can be deleted to.

Definition at line 2020 of file InternetContent.cs.

◆ CanGet()

static bool Waher.Content.InternetContent.CanGet ( Uri  Uri,
out Grade  Grade,
out IContentGetter  Getter 
)
static

If a resource can be gotten, given its URI.

Parameters
UriURI of resource.
GradeHow well the getter can get the resource.
GetterBest getter for the URI.
Returns
If a resource with the given URI can be gotten.

Definition at line 1087 of file InternetContent.cs.

◆ CanHead()

static bool Waher.Content.InternetContent.CanHead ( Uri  Uri,
out Grade  Grade,
out IContentHeader  Header 
)
static

If the headers of a resource can be gotten, given its URI.

Parameters
UriURI of resource.
GradeHow well the headers of the resource can be retrieved.
HeaderBest header-retriever for the URI.
Returns
If the headers of a resource with the given URI can be retrieved.

Definition at line 2236 of file InternetContent.cs.

◆ CanPost()

static bool Waher.Content.InternetContent.CanPost ( Uri  Uri,
out Grade  Grade,
out IContentPoster  Poster 
)
static

If a resource can be posted to, given its URI.

Parameters
UriURI of resource.
GradeHow well the posted can post to the resource.
PosterBest poster for the URI.
Returns
If a resource with the given URI can be posted to.

Definition at line 1385 of file InternetContent.cs.

◆ CanPut()

static bool Waher.Content.InternetContent.CanPut ( Uri  Uri,
out Grade  Grade,
out IContentPutter  Putter 
)
static

If a resource can be putted to, given its URI.

Parameters
UriURI of resource.
GradeHow well the putted can put to the resource.
PutterBest putter for the URI.
Returns
If a resource with the given URI can be putted to.

Definition at line 1704 of file InternetContent.cs.

◆ Decode() [1/2]

static object Waher.Content.InternetContent.Decode ( string  ContentType,
byte[]  Data,
Encoding  Encoding,
KeyValuePair< string, string >[]  Fields,
Uri  BaseUri 
)
static

Decodes an object.

Parameters
ContentTypeInternet Content Type.
DataEncoded object.
EncodingAny encoding specified. Can be null if no encoding specified.
FieldsAny content-type related fields and their corresponding values.
BaseUriBase URI, if any. If not available, value is null.
Returns
Decoded object.
Exceptions
ArgumentExceptionIf the object cannot be decoded.

Definition at line 532 of file InternetContent.cs.

◆ Decode() [2/2]

static object Waher.Content.InternetContent.Decode ( string  ContentType,
byte[]  Data,
Uri  BaseUri 
)
static

Decodes an object.

Parameters
ContentTypeInternet Content Type.
DataEncoded object.
BaseUriBase URI, if any. If not available, value is null.
Returns
Decoded object.
Exceptions
ArgumentExceptionIf the object cannot be decoded.

Definition at line 564 of file InternetContent.cs.

◆ DecodeAsync() [1/2]

static Task< object > Waher.Content.InternetContent.DecodeAsync ( string  ContentType,
byte[]  Data,
Encoding  Encoding,
KeyValuePair< string, string >[]  Fields,
Uri  BaseUri 
)
static

Decodes an object.

Parameters
ContentTypeInternet Content Type.
DataEncoded object.
EncodingAny encoding specified. Can be null if no encoding specified.
FieldsAny content-type related fields and their corresponding values.
BaseUriBase URI, if any. If not available, value is null.
Returns
Decoded object.
Exceptions
ArgumentExceptionIf the object cannot be decoded.

Definition at line 547 of file InternetContent.cs.

◆ DecodeAsync() [2/2]

static Task< object > Waher.Content.InternetContent.DecodeAsync ( string  ContentType,
byte[]  Data,
Uri  BaseUri 
)
static

Decodes an object.

Parameters
ContentTypeInternet Content Type.
DataEncoded object.
BaseUriBase URI, if any. If not available, value is null.
Returns
Decoded object.
Exceptions
ArgumentExceptionIf the object cannot be decoded.

Definition at line 577 of file InternetContent.cs.

◆ Decodes()

static bool Waher.Content.InternetContent.Decodes ( string  ContentType,
out Grade  Grade,
out IContentDecoder  Decoder 
)
static

If an object with a given content type can be decoded.

Parameters
ContentTypeContent type to decode.
GradeHow well the decoder decodes the object.
DecoderBest decoder for the object.
Returns
If an object with the given type can be decoded.

Definition at line 488 of file InternetContent.cs.

◆ DeleteAsync() [1/6]

static Task< object > Waher.Content.InternetContent.DeleteAsync ( Uri  Uri,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Deletes a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 2102 of file InternetContent.cs.

◆ DeleteAsync() [2/6]

static Task< object > Waher.Content.InternetContent.DeleteAsync ( Uri  Uri,
params KeyValuePair< string, string >[]  Headers 
)
static

Deletes a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 2061 of file InternetContent.cs.

◆ DeleteAsync() [3/6]

static Task< object > Waher.Content.InternetContent.DeleteAsync ( Uri  Uri,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Deletes a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 2115 of file InternetContent.cs.

◆ DeleteAsync() [4/6]

static Task< object > Waher.Content.InternetContent.DeleteAsync ( Uri  Uri,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Deletes a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 2073 of file InternetContent.cs.

◆ DeleteAsync() [5/6]

static Task< object > Waher.Content.InternetContent.DeleteAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Deletes a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 2129 of file InternetContent.cs.

◆ DeleteAsync() [6/6]

static Task< object > Waher.Content.InternetContent.DeleteAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Deletes a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 2086 of file InternetContent.cs.

◆ Encode()

static byte[] Waher.Content.InternetContent.Encode ( object  Object,
Encoding  Encoding,
out string  ContentType,
params string[]  AcceptedContentTypes 
)
static

Encodes an object.

Parameters
ObjectObject to encode.
EncodingDesired encoding of text. Can be null if no desired encoding is speified.
ContentTypeContent Type of encoding. Includes information about any text encodings used.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.
Returns
Encoded object.
Exceptions
ArgumentExceptionIf the object cannot be encoded.

Definition at line 309 of file InternetContent.cs.

◆ EncodeAsync()

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.EncodeAsync ( object  Object,
Encoding  Encoding,
params string[]  AcceptedContentTypes 
)
static

Encodes an object.

Parameters
ObjectObject to encode.
EncodingDesired encoding of text. Can be null if no desired encoding is speified.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.
Returns
Encoded object, and Content Type of encoding. Includes information about any text encodings used.
Exceptions
ArgumentExceptionIf the object cannot be encoded.

Definition at line 324 of file InternetContent.cs.

◆ Encodes()

static bool Waher.Content.InternetContent.Encodes ( object  Object,
out Grade  Grade,
out IContentEncoder  Encoder,
params string[]  AcceptedContentTypes 
)
static

If a given object can be encoded.

Parameters
ObjectObject to encode.
GradeHow well the object can be encoded.
EncoderBest encoder for the object.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.
Returns
If the object can be encoded.

Definition at line 229 of file InternetContent.cs.

◆ GetAsync() [1/6]

static Task< object > Waher.Content.InternetContent.GetAsync ( Uri  Uri,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a resource, given its URI.

Parameters
UriUniform resource identifier.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 1169 of file InternetContent.cs.

◆ GetAsync() [2/6]

static Task< object > Waher.Content.InternetContent.GetAsync ( Uri  Uri,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a resource, given its URI.

Parameters
UriUniform resource identifier.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 1128 of file InternetContent.cs.

◆ GetAsync() [3/6]

static Task< object > Waher.Content.InternetContent.GetAsync ( Uri  Uri,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 1182 of file InternetContent.cs.

◆ GetAsync() [4/6]

static Task< object > Waher.Content.InternetContent.GetAsync ( Uri  Uri,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 1140 of file InternetContent.cs.

◆ GetAsync() [5/6]

static Task< object > Waher.Content.InternetContent.GetAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 1196 of file InternetContent.cs.

◆ GetAsync() [6/6]

static Task< object > Waher.Content.InternetContent.GetAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 1153 of file InternetContent.cs.

◆ GetContentType()

static string Waher.Content.InternetContent.GetContentType ( string  FileExtension)
static

Gets the content type of an item, given its file extension. It uses the TryGetContentType to see if any of the content encoders/decoders support content with the corresponding file type. If no such encoder/decoder is found, the generic application/octet-stream type is returned.

Parameters
FileExtensionFile extension.
Returns
Content type.

Definition at line 652 of file InternetContent.cs.

◆ GetConverters()

static IContentConverter[] Waher.Content.InternetContent.GetConverters ( string  FromContentType)
static

Gets available converters that can convert content from a given type.

Parameters
FromContentTypeFrom which content type converters have to convert.
Returns
Available converters, or null if there are none.

Definition at line 976 of file InternetContent.cs.

◆ GetEncoding()

static Encoding Waher.Content.InternetContent.GetEncoding ( string  CharacterSet)
static

Gets a character encoding from its name.

Parameters
CharacterSetName of character set.
Returns
Encoding.

Definition at line 606 of file InternetContent.cs.

◆ GetFileExtension()

static string Waher.Content.InternetContent.GetFileExtension ( string  ContentType)
static

Gets the file extension of an item, given its content type. It uses the TryGetFileExtension to see if any of the content encoders/decoders support content with the corresponding content type. If no such encoder/decoder is found, the generic bin extension is returned.

Parameters
ContentTypeFile Content-Type.
Returns
File extension.

Definition at line 714 of file InternetContent.cs.

◆ GetTempStreamAsync() [1/6]

static Task< KeyValuePair< string, TemporaryStream > > Waher.Content.InternetContent.GetTempStreamAsync ( Uri  Uri,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a (possibly big) resource, given its URI.

Parameters
UriUniform resource identifier.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Content-Type, together with a Temporary file, if resource has been downloaded, or null if resource is data-less.

Definition at line 1252 of file InternetContent.cs.

◆ GetTempStreamAsync() [2/6]

static Task< KeyValuePair< string, TemporaryStream > > Waher.Content.InternetContent.GetTempStreamAsync ( Uri  Uri,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a (possibly big) resource, given its URI.

Parameters
UriUniform resource identifier.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Content-Type, together with a Temporary file, if resource has been downloaded, or null if resource is data-less.

Definition at line 1211 of file InternetContent.cs.

◆ GetTempStreamAsync() [3/6]

static Task< KeyValuePair< string, TemporaryStream > > Waher.Content.InternetContent.GetTempStreamAsync ( Uri  Uri,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a (possibly big) resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Content-Type, together with a Temporary file, if resource has been downloaded, or null if resource is data-less.

Definition at line 1265 of file InternetContent.cs.

◆ GetTempStreamAsync() [4/6]

static Task< KeyValuePair< string, TemporaryStream > > Waher.Content.InternetContent.GetTempStreamAsync ( Uri  Uri,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a (possibly big) resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Content-Type, together with a Temporary file, if resource has been downloaded, or null if resource is data-less.

Definition at line 1223 of file InternetContent.cs.

◆ GetTempStreamAsync() [5/6]

static Task< KeyValuePair< string, TemporaryStream > > Waher.Content.InternetContent.GetTempStreamAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a (possibly big) resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Content-Type, together with a Temporary file, if resource has been downloaded, or null if resource is data-less.

Definition at line 1279 of file InternetContent.cs.

◆ GetTempStreamAsync() [6/6]

static Task< KeyValuePair< string, TemporaryStream > > Waher.Content.InternetContent.GetTempStreamAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Gets a (possibly big) resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Content-Type, together with a Temporary file, if resource has been downloaded, or null if resource is data-less.

Definition at line 1236 of file InternetContent.cs.

◆ HeadAsync() [1/6]

static Task< object > Waher.Content.InternetContent.HeadAsync ( Uri  Uri,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Heads a resource, given its URI.

Parameters
UriUniform resource identifier.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 2318 of file InternetContent.cs.

◆ HeadAsync() [2/6]

static Task< object > Waher.Content.InternetContent.HeadAsync ( Uri  Uri,
params KeyValuePair< string, string >[]  Headers 
)
static

Heads a resource, given its URI.

Parameters
UriUniform resource identifier.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 2277 of file InternetContent.cs.

◆ HeadAsync() [3/6]

static Task< object > Waher.Content.InternetContent.HeadAsync ( Uri  Uri,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Heads a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 2331 of file InternetContent.cs.

◆ HeadAsync() [4/6]

static Task< object > Waher.Content.InternetContent.HeadAsync ( Uri  Uri,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Heads a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 2289 of file InternetContent.cs.

◆ HeadAsync() [5/6]

static Task< object > Waher.Content.InternetContent.HeadAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Heads a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 2345 of file InternetContent.cs.

◆ HeadAsync() [6/6]

static Task< object > Waher.Content.InternetContent.HeadAsync ( Uri  Uri,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Heads a resource, given its URI.

Parameters
UriUniform resource identifier.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Object.

Definition at line 2302 of file InternetContent.cs.

◆ IsAccepted() [1/3]

static bool Waher.Content.InternetContent.IsAccepted ( string  ContentType,
params string[]  AcceptedContentTypes 
)
static

Checks if a given content type is acceptable.

Parameters
ContentTypeContent type.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.

Definition at line 337 of file InternetContent.cs.

◆ IsAccepted() [2/3]

static bool Waher.Content.InternetContent.IsAccepted ( string[]  ContentTypes,
out string  ContentType,
params string[]  AcceptedContentTypes 
)
static

Checks if at least one content type in a set of content types is acceptable.

Parameters
ContentTypesContent types.
ContentTypeContent type selected as the first acceptable content type.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.

Definition at line 361 of file InternetContent.cs.

◆ IsAccepted() [3/3]

static bool Waher.Content.InternetContent.IsAccepted ( string[]  ContentTypes,
params string[]  AcceptedContentTypes 
)
static

Checks if at least one content type in a set of content types is acceptable.

Parameters
ContentTypesContent types.
AcceptedContentTypesOptional array of accepted content types. If array is empty, all content types are accepted.

Definition at line 350 of file InternetContent.cs.

◆ PostAsync() [1/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be posted.
ContentTypeContent-Type of encoded data in EncodedData .
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1565 of file InternetContent.cs.

◆ PostAsync() [2/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be posted.
ContentTypeContent-Type of encoded data in EncodedData .
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1517 of file InternetContent.cs.

◆ PostAsync() [3/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be posted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1580 of file InternetContent.cs.

◆ PostAsync() [4/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be posted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1531 of file InternetContent.cs.

◆ PostAsync() [5/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be posted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1597 of file InternetContent.cs.

◆ PostAsync() [6/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be posted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1547 of file InternetContent.cs.

◆ PostAsync() [7/12]

static Task< object > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
object  Data,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to post.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1471 of file InternetContent.cs.

◆ PostAsync() [8/12]

static Task< object > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
object  Data,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to post.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1427 of file InternetContent.cs.

◆ PostAsync() [9/12]

static Task< object > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to post.
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1485 of file InternetContent.cs.

◆ PostAsync() [10/12]

static Task< object > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to post.
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1440 of file InternetContent.cs.

◆ PostAsync() [11/12]

static Task< object > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to post.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1500 of file InternetContent.cs.

◆ PostAsync() [12/12]

static Task< object > Waher.Content.InternetContent.PostAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Posts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to post.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1454 of file InternetContent.cs.

◆ PutAsync() [1/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be putted.
ContentTypeContent-Type of encoded data in EncodedData .
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1883 of file InternetContent.cs.

◆ PutAsync() [2/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be putted.
ContentTypeContent-Type of encoded data in EncodedData .
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1836 of file InternetContent.cs.

◆ PutAsync() [3/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be putted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1898 of file InternetContent.cs.

◆ PutAsync() [4/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be putted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1850 of file InternetContent.cs.

◆ PutAsync() [5/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be putted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1914 of file InternetContent.cs.

◆ PutAsync() [6/12]

static Task< KeyValuePair< byte[], string > > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
byte[]  EncodedData,
string  ContentType,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
EncodedDataEncoded data to be putted.
ContentTypeContent-Type of encoded data in EncodedData .
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Encoded response.

Definition at line 1865 of file InternetContent.cs.

◆ PutAsync() [7/12]

static Task< object > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
object  Data,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to put.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1790 of file InternetContent.cs.

◆ PutAsync() [8/12]

static Task< object > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
object  Data,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to put.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1746 of file InternetContent.cs.

◆ PutAsync() [9/12]

static Task< object > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to put.
CertificateOptional client certificate to use in a Mutual TLS session.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1804 of file InternetContent.cs.

◆ PutAsync() [10/12]

static Task< object > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to put.
CertificateOptional client certificate to use in a Mutual TLS session.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1759 of file InternetContent.cs.

◆ PutAsync() [11/12]

static Task< object > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
int  TimeoutMs,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to put.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
TimeoutMsTimeout, in milliseconds. (Default=60000)
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1819 of file InternetContent.cs.

◆ PutAsync() [12/12]

static Task< object > Waher.Content.InternetContent.PutAsync ( Uri  Uri,
object  Data,
X509Certificate  Certificate,
RemoteCertificateEventHandler  RemoteCertificateValidator,
params KeyValuePair< string, string >[]  Headers 
)
static

Puts to a resource, using a Uniform Resource Identifier (or Locator).

Parameters
UriURI
DataData to put.
CertificateOptional client certificate to use in a Mutual TLS session.
RemoteCertificateValidatorOptional validator of remote certificates.
HeadersOptional headers. Interpreted in accordance with the corresponding URI scheme.
Returns
Decoded response.

Definition at line 1773 of file InternetContent.cs.

◆ TryGetContentType()

static bool Waher.Content.InternetContent.TryGetContentType ( string  FileExtension,
out string  ContentType 
)
static

Tries to get the content type of an item, given its file extension.

Parameters
FileExtensionFile extension.
ContentTypeContent type.
Returns
If the extension was recognized.

Definition at line 666 of file InternetContent.cs.

◆ TryGetFileExtension()

static bool Waher.Content.InternetContent.TryGetFileExtension ( string  ContentType,
out string  FileExtension 
)
static

Tries to get the file extension of an item, given its content type.

Parameters
ContentTypeContent type.
FileExtensionFile extension.
Returns
If the Content-Type was recognized.

Definition at line 728 of file InternetContent.cs.

Member Data Documentation

◆ ISO_8859_1

readonly Encoding Waher.Content.InternetContent.ISO_8859_1 = Encoding.GetEncoding("ISO-8859-1")
static

ISO-8859-1 character encoding.

Definition at line 21 of file InternetContent.cs.

Property Documentation

◆ CanDecodeContentTypes

string [] Waher.Content.InternetContent.CanDecodeContentTypes
staticget

Internet content types that can be decoded.

Definition at line 392 of file InternetContent.cs.

◆ CanDecodeFileExtensions

string [] Waher.Content.InternetContent.CanDecodeFileExtensions
staticget

File extensions that can be decoded.

Definition at line 419 of file InternetContent.cs.

◆ CanDeleteToUriSchemes

string [] Waher.Content.InternetContent.CanDeleteToUriSchemes
staticget

Internet URI Schemes that can be deleted to.

Definition at line 1930 of file InternetContent.cs.

◆ CanEncodeContentTypes

string [] Waher.Content.InternetContent.CanEncodeContentTypes
staticget

Internet content types that can be encoded.

Definition at line 132 of file InternetContent.cs.

◆ CanEncodeFileExtensions

string [] Waher.Content.InternetContent.CanEncodeFileExtensions
staticget

File extensions that can be encoded.

Definition at line 159 of file InternetContent.cs.

◆ CanGetUriSchemes

string [] Waher.Content.InternetContent.CanGetUriSchemes
staticget

Internet URI Schemes that can be gotten.

Definition at line 997 of file InternetContent.cs.

◆ CanHeadUriSchemes

string [] Waher.Content.InternetContent.CanHeadUriSchemes
staticget

Internet URI Schemes where it is possible to get headers.

Definition at line 2146 of file InternetContent.cs.

◆ CanPostToUriSchemes

string [] Waher.Content.InternetContent.CanPostToUriSchemes
staticget

Internet URI Schemes that can be posted to.

Definition at line 1295 of file InternetContent.cs.

◆ CanPutToUriSchemes

string [] Waher.Content.InternetContent.CanPutToUriSchemes
staticget

Internet URI Schemes that can be putted to.

Definition at line 1614 of file InternetContent.cs.

◆ Converters

IContentConverter [] Waher.Content.InternetContent.Converters
staticget

Available Internet Content Converters.

Definition at line 775 of file InternetContent.cs.

◆ Decoders

IContentDecoder [] Waher.Content.InternetContent.Decoders
staticget

Available Internet Content Decoders.

Definition at line 446 of file InternetContent.cs.

◆ Deleters

IContentDeleter [] Waher.Content.InternetContent.Deleters
staticget

Available Internet Content Deleters.

Definition at line 1957 of file InternetContent.cs.

◆ Encoders

IContentEncoder [] Waher.Content.InternetContent.Encoders
staticget

Available Internet Content Encoders.

Definition at line 186 of file InternetContent.cs.

◆ Getters

IContentGetter [] Waher.Content.InternetContent.Getters
staticget

Available Internet Content Getters.

Definition at line 1024 of file InternetContent.cs.

◆ Headers

IContentHeader [] Waher.Content.InternetContent.Headers
staticget

Available Internet Content Header-retrievers.

Definition at line 2173 of file InternetContent.cs.

◆ Posters

IContentPoster [] Waher.Content.InternetContent.Posters
staticget

Available Internet Content Posters.

Definition at line 1322 of file InternetContent.cs.

◆ Putters

IContentPutter [] Waher.Content.InternetContent.Putters
staticget

Available Internet Content Putters.

Definition at line 1641 of file InternetContent.cs.


The documentation for this class was generated from the following file: