Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ContentBinaryResponse.cs
1using System;
2
3namespace Waher.Content
4{
9 {
16 {
17 this.ContentType = ContentType;
18 this.Encoded = Encoded;
19 this.HasError = false;
20 this.Error = null;
21 }
22
27 public ContentBinaryResponse(Exception Error)
28 {
29 this.ContentType = null;
30 this.Encoded = null;
31 this.HasError = true;
32 this.Error = Error;
33 }
34
38 public string ContentType { get; }
39
43 public byte[] Encoded { get; }
44
48 public bool HasError { get; }
49
53 public Exception Error { get; }
54
58 public void AssertOk()
59 {
60 if (this.HasError)
61 throw this.Error;
62 }
63 }
64}
Contains information about a binary response to a content request.
string ContentType
Internet Content-Type of encoded object.
ContentBinaryResponse(Exception Error)
Contains information about an error binary response to a content request.
ContentBinaryResponse(string ContentType, byte[] Encoded)
Contains information about a success binary response to a content request.
void AssertOk()
Asserts response is OK.