RRequest class
Il riferimento e' in inglese: viene dai commenti del sorgente di RAVAL, che dalla 2.0 ha nomi e commenti in inglese.
public sealed class RRequestAn HTTP request received by RServer, with the body already read.
Costruttori
RRequest(HttpContext context, string body, JsonSerializerOptions json)The request created by RServer, with the body already read as text.
ProprietÃ
HttpContext Context { get; }The ASP.NET Core context, for whoever needs something that is not here.
string Method { get; }The method: GET, POST, PUT, DELETE...
string Path { get; }The requested path, for instance «/api/machines/3».
string Text { get; }The body of the request as text («» if there is none).
Metodi
string Param(string name)A parameter: first those of the path («/api/machines/{id}»), then those after the ? («?filter=red»). null if missing.
int Int(string name)An integer parameter; if missing or not a number it throws RHttpError 400, which becomes the response.
string Header(string name)A header of the request (null if missing).
T Body<T>()The body read as an object from JSON. If the body is missing or is not valid JSON for that type it throws RHttpError 400, which becomes the response: the program's method always gets a real object.