convert Enums to int for request; fix method in addMonitor
This commit is contained in:
@@ -143,7 +143,7 @@ namespace UptimeSharp
|
||||
HTTPUsername = HTTPUsername
|
||||
};
|
||||
|
||||
DefaultResponse response = await Request<DefaultResponse>("getMonitors", cancellationToken, parameters.Convert());
|
||||
DefaultResponse response = await Request<DefaultResponse>("newMonitor", cancellationToken, parameters.Convert());
|
||||
return response.Status;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace UptimeSharp.Models
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace UptimeSharp.Models
|
||||
value = (int)((DateTime)value - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
}
|
||||
|
||||
if (value is Enum)
|
||||
{
|
||||
value = (int)value;
|
||||
}
|
||||
|
||||
parameterDict.Add(name, value.ToString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user