Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
AgentGetResource.cs
1using System.Threading.Tasks;
4
6{
11 {
16 public AgentGetResource(string AgentResourceName)
17 : base(AgentResourceName)
18 {
19 }
20
24 public virtual bool AllowsGET => true;
25
32 public virtual Task GET(HttpRequest Request, HttpResponse Response)
33 {
34 if (this.Api is null)
35 throw new ServiceUnavailableException("API not available.");
36
37 SetTransparentCorsHeaders(this, Request, Response);
38
39 return Task.CompletedTask;
40 }
41 }
42}
Represents an HTTP request.
Definition: HttpRequest.cs:18
static void SetTransparentCorsHeaders(HttpResource Resource, HttpRequest Request, HttpResponse Response)
Sets CORS headers for a resource, allowing it to be embedded in other sites.
Represets a response of an HTTP client request.
Definition: HttpResponse.cs:21
The server is currently unable to handle the request due to a temporary overloading or maintenance of...
Abstract base class for agent resources supporting the GET method.
virtual bool AllowsGET
If the GET method is allowed.
virtual Task GET(HttpRequest Request, HttpResponse Response)
Executes the GET method on the resource.
AgentGetResource(string AgentResourceName)
Abstract base class for agent resources supporting the GET method.
Abstract base class for agent resources
GET Interface for HTTP resources.