2using System.Threading.Tasks;
72 await this.Process(Bin, Response,
true);
100 byte[] Bin =
new byte[c];
101 await Request.
DataStream.ReadAllAsync(Bin, 0, c);
103 await this.Process(Bin, Response,
false);
112 private async Task Process(
byte[] ReqBin,
HttpResponse Response,
bool Cache)
125 RespBin[0] = ReqBin[0];
126 RespBin[1] = ReqBin[1];
128 Response.StatusCode = 200;
135 Response.
SetHeader(
"Cache-Control",
"max-age=" + Seconds.ToString());
138 await Response.
Write(RespBin);
Static class that does BASE64URL encoding (using URL and filename safe alphabet), as defined in RFC46...
static byte[] Decode(string Base64Url)
Converts a Base64URL-encoded string to its binary representation.
Question[] Questions
Question section
DateTime Expires
When record expires
byte[] Raw
Raw DNS message
Contains information about a DNS Question
DNS resolver, as defined in:
static Task< DnsResponse > Query(string Name, QTYPE TYPE, QCLASS CLASS)
Resolves a DNS name.
async Task POST(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
DnsOverHttpsResource()
DNS over HTTPS resource.
bool AllowsGET
If the GET method is allowed.
override bool UserSessions
If the resource uses user sessions.
async Task GET(HttpRequest Request, HttpResponse Response)
Executes the GET method on the resource.
override bool HandlesSubPaths
If the resource handles sub-paths.
const string ContentType
application/dns-message
bool AllowsPOST
If the POST method is allowed.
DnsOverHttpsResource(string ResourceName)
DNS over HTTPS resource.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
Stream DataStream
Data stream, if data is available, or null if data is not available.
HttpRequestHeader Header
Request header.
bool HasData
If the request has data.
string ResourceName
Name of resource.
Represets a response of an HTTP client request.
async Task SendResponse()
Sends the response back to the client. If the resource is synchronous, there's no need to call this m...
void SetHeader(string FieldName, string Value)
Sets a custom header field value.
async Task Write(byte[] Data)
Returns binary data in the response.
Base class for all synchronous HTTP resources. A synchronous resource responds within the method hand...
The resource identified by the request is only capable of generating response entities which have con...
GET Interface for HTTP resources.
POST Interface for HTTP resources.