Class Http
An Http action that can be included on a ReceivedMessage or SendingMessage. Sends a HTTP request when the action button is tapped.
Implements
Inherited Members
Namespace: ntfy.Actions
Assembly: ntfy.dll
Syntax
public class Http : Action, IAction
Constructors
| Improve this Doc View SourceHttp(string, Uri)
Constructor for an Http action.
Declaration
public Http(string label, Uri url)
Parameters
Type | Name | Description |
---|---|---|
string | label | The label for the action. |
Uri | url | The URL to which the HTTP request will be sent. |
Properties
| Improve this Doc View SourceBody
Optional body to include in the Http request.
Declaration
[JsonProperty("body", Required = Required.AllowNull, NullValueHandling = NullValueHandling.Ignore)]
public string? Body { get; set; }
Property Value
Type | Description |
---|---|
string |
Clear
Whether to clear the associated notification after the HTTP request succeeds.
If the request fails, the notification is not cleared.
Defaults to false
.
Declaration
[JsonProperty("clear", Required = Required.AllowNull, NullValueHandling = NullValueHandling.Ignore)]
public bool? Clear { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Headers
Optional headers to include in the Http request.
Declaration
[JsonProperty("headers", Required = Required.AllowNull, NullValueHandling = NullValueHandling.Ignore)]
public Dictionary<string, string>? Headers { get; set; }
Property Value
Type | Description |
---|---|
Dictionary<string, string> |
Method
The HTTP method to use when sending the request.
Defaults to HttpMethod.Post
Declaration
[JsonIgnore]
public HttpMethod? Method { get; set; }
Property Value
Type | Description |
---|---|
HttpMethod |
MethodString
The HTTP method to use when sending the request, as a string.
Defaults to "POST"
This representation is used by API calls, and is hidden from end users.
Declaration
[JsonProperty("method", Required = Required.AllowNull, NullValueHandling = NullValueHandling.Ignore)]
public string? MethodString { get; set; }
Property Value
Type | Description |
---|---|
string |
Type
The type of this action, as an ActionType enum.
Declaration
[JsonIgnore]
public override ActionType Type { get; }
Property Value
Type | Description |
---|---|
ActionType |
Overrides
| Improve this Doc View SourceUrl
The URL to which the HTTP request will be sent.
Declaration
[JsonProperty("url", Required = Required.AllowNull, NullValueHandling = NullValueHandling.Ignore)]
public Uri Url { get; set; }
Property Value
Type | Description |
---|---|
Uri |