2using System.Threading.Tasks;
14 : base(
"/CreateAccount")
18 public override bool HandlesSubPaths =>
false;
19 public override bool UserSessions =>
true;
33 if (Content.
HasError || !(Content.
Decoded is Dictionary<string, string> Form))
50 if (!Form.ContainsKey(
"Password") ||
string.IsNullOrEmpty(Password = Form[
"Password"]))
63 PhoneNr =
string.
Empty;
66 KeyValuePair<IAccount, string[]> P = await PersistenceLayer.
CreateAccount(
string.Empty, UserName, Password, EMail, PhoneNr, Request.
RemoteEndPoint);
78 internal static KeyValuePair<string, string>[] GetAlterntivesHeaders(
string[] Alternatives)
80 int i, c = Alternatives?.Length ?? 0;
81 KeyValuePair<string, string>[] Suggestions =
new KeyValuePair<string, string>[c];
83 for (i = 0; i < c; i++)
84 Suggestions[i] =
new KeyValuePair<string, string>(
"X-AlternativeName" + (i + 1).
ToString(), Alternatives[i]);
Contains information about a response to a content request.
bool HasError
If an error occurred.
object Decoded
Decoded object.
Static class managing the runtime environment of the IoT Gateway.
static IUser AssertUserAuthenticated(HttpRequest Request, string Privilege)
Makes sure a request is being made from a session with a successful user login.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
The request could not be completed due to a conflict with the current state of the resource....
Represents an HTTP request.
string RemoteEndPoint
Remote end-point.
bool HasData
If the request has data.
async Task< ContentResponse > DecodeDataAsync()
Decodes data sent in request.
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...
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.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
Task< KeyValuePair< Networking.XMPP.Server.IAccount, string[]> > CreateAccount(string ApiKey, CaseInsensitiveString UserName, string Password, CaseInsensitiveString EMail, CaseInsensitiveString PhoneNr, string RemoteEndPoint)
Creates an account.
async Task POST(HttpRequest Request, HttpResponse Response)
Executes the POST method on the resource.
bool AllowsPOST
If the POST method is allowed.
POST Interface for HTTP resources.
CaseInsensitiveString UserName
User Name
Interface for XMPP user accounts.
delegate string ToString(IElement Element)
Delegate for callback methods that convert an element value to a string.