2using System.Threading.Tasks;
72 await this.Process(Bin, Response,
true);
99 byte[] Bin = await Request.
DataStream.ReadAllAsync();
100 await this.Process(Bin, Response,
false);
109 private async Task Process(
byte[] ReqBin,
HttpResponse Response,
bool Cache)
122 RespBin[0] = ReqBin[0];
123 RespBin[1] = ReqBin[1];
125 Response.StatusCode = 200;
126 Response.StatusMessage =
"OK";
133 Response.
SetHeader(
"Cache-Control",
"max-age=" + Seconds.ToString());
136 await Response.
Write(
true, 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 > TryQuery(string Name, QTYPE TYPE, QCLASS CLASS)
Tries to query 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...
Task Write(byte[] Data)
Returns binary data in the response.
void SetHeader(string FieldName, string Value)
Sets a custom header field value.
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.