2using System.Collections.Generic;
4using System.Threading.Tasks;
15 : base(
"/RequestApiKey")
19 public override bool HandlesSubPaths =>
false;
20 public override bool UserSessions =>
true;
29 if (!(Obj is Dictionary<string, string> Form))
40 string RecaptchaResponse;
42 if (!Form.ContainsKey(
"Name") ||
string.IsNullOrEmpty(Name = Form[
"Name"]))
48 if (!Form.ContainsKey(
"LinkedIn") ||
string.IsNullOrEmpty(LinkedIn = Form[
"LinkedIn"]))
51 if (!Form.ContainsKey(
"Organization") ||
string.IsNullOrEmpty(Organization = Form[
"Organization"]))
54 if (!Form.ContainsKey(
"Product") ||
string.IsNullOrEmpty(Product = Form[
"Product"]))
57 if (!Form.ContainsKey(
"Number") ||
string.IsNullOrEmpty(Number = Form[
"Number"]))
60 if (!Form.ContainsKey(
"Where") ||
string.IsNullOrEmpty(Where = Form[
"Where"]))
63 if (!Form.ContainsKey(
"TimeLimit") ||
string.IsNullOrEmpty(TimeLimit = Form[
"TimeLimit"]))
64 TimeLimit =
string.Empty;
66 if (!Form.ContainsKey(
"g-recaptcha-response") ||
string.IsNullOrEmpty(RecaptchaResponse = Form[
"g-recaptcha-response"]))
72 new KeyValuePair<string, object>(
"Name", Name),
73 new KeyValuePair<string, object>(
"EMail", EMail.
Value),
74 new KeyValuePair<string, object>(
"LinkedIn", LinkedIn),
75 new KeyValuePair<string, object>(
"Organization", Organization),
76 new KeyValuePair<string, object>(
"Product", Product),
77 new KeyValuePair<string, object>(
"Number", Number),
78 new KeyValuePair<string, object>(
"Where", Where),
79 new KeyValuePair<string, object>(
"TimeLimit", TimeLimit),
80 new KeyValuePair<string, object>(
"RemoteEndPoint", Request.
RemoteEndPoint));
82 Dictionary<string, object>
Feedback =
new Dictionary<string, object>();
83 foreach (KeyValuePair<string, object> P
in Tags)
88 StringBuilder Markdown =
new StringBuilder();
89 DateTime Now = DateTime.Now;
91 Markdown.AppendLine(
"API key requested.");
92 Markdown.AppendLine();
94 Markdown.AppendLine(
"| API Key request ||");
95 Markdown.AppendLine(
"|:------|:-------|");
97 Markdown.Append(
"| Name: | ");
99 Markdown.AppendLine(
" |");
101 Markdown.Append(
"| e-Mail: | <a href=\"mailto:");
102 Markdown.Append(EMail.
Replace(
"\"",
"""));
103 Markdown.Append(
"\" target=\"_blank\">");
105 Markdown.AppendLine(
"</a> |");
107 Markdown.Append(
"| LinkedIn: | <a href=\"");
108 Markdown.Append(LinkedIn.Replace(
"\"",
"""));
109 Markdown.Append(
"\" target=\"_blank\">");
111 Markdown.AppendLine(
"</a> |");
113 Markdown.Append(
"| Organization: | ");
115 Markdown.AppendLine(
" |");
117 Markdown.Append(
"| Product: | ");
119 Markdown.AppendLine(
" |");
121 Markdown.Append(
"| Number: | ");
123 Markdown.AppendLine(
" |");
125 Markdown.Append(
"| Where: | ");
127 Markdown.AppendLine(
" |");
129 Markdown.Append(
"| Time Limit: | ");
131 Markdown.AppendLine(
" |");
135 Markdown.Append(
"| Date | ");
137 Markdown.AppendLine(
" |");
138 Markdown.Append(
"| Time | ");
140 Markdown.AppendLine(
" |");
144 await IoTGateway.Gateway.SendNotification(Markdown.ToString());
Contains a markdown document. This markdown document class supports original markdown,...
static string Encode(string s)
Encodes all special characters in a string so that it can be included in a markdown document without ...
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
The server understood the request, but is refusing to fulfill it. Authorization will not help and the...
Represents an HTTP request.
string RemoteEndPoint
Remote end-point.
bool HasData
If the request has data.
Variables Session
Contains session states, if the resource requires sessions, or null otherwise.
async Task< object > DecodeDataAsync()
Decodes data sent in request.
Represets a response of an HTTP client request.
Base class for all synchronous HTTP resources. A synchronous resource responds within the method hand...
The response to the request can be found under a different URI and SHOULD be retrieved using a GET me...
Represents a case-insensitive string.
string Value
String-representation of the case-insensitive string. (Representation is case sensitive....
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
CaseInsensitiveString Replace(CaseInsensitiveString oldValue, CaseInsensitiveString newValue)
Returns a new string in which all occurrences of a specified string in the current instance are repla...
Class that monitors login events, and help applications determine malicious intent....
static async Task< string > AppendWhoIsInfo(StringBuilder Markdown, string RemoteEndpoint)
Appends WHOIS information to a Markdown document.
static async Task< KeyValuePair< string, object >[]> Annotate(string RemoteEndpoint, params KeyValuePair< string, object >[] Tags)
Annotates a remote endpoint.
bool AllowsPOST
If the POST method is allowed.
async Task POST(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
Service Module hosting the XMPP broker and its components.
static async Task AppendRemoteEndpointToTable(StringBuilder Markdown, string RemoteEndpoint)
Appends annotated information about a remote endpoint to a Markdown table.
POST Interface for HTTP resources.