mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-06 16:25:01 +00:00
fix: minor Web API enhancements
* changed path for DevJson to include the device key instead of requiring it in the body * Made the `GetRequestBody` method an extension method for the `HttpCwsRequest` class
This commit is contained in:
@@ -7,11 +7,11 @@ using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Web
|
||||
{
|
||||
public class EssentialsWebApiHelpers
|
||||
public static class EssentialsWebApiHelpers
|
||||
{
|
||||
public static string GetRequestBody(HttpCwsRequest request)
|
||||
public static string GetRequestBody(this HttpCwsRequest request)
|
||||
{
|
||||
var bytes = new Byte[request.ContentLength];
|
||||
var bytes = new byte[request.ContentLength];
|
||||
|
||||
request.InputStream.Read(bytes, 0, request.ContentLength);
|
||||
|
||||
@@ -22,8 +22,8 @@ namespace PepperDash.Essentials.Core.Web
|
||||
{
|
||||
return new
|
||||
{
|
||||
Name = assembly.Name,
|
||||
Version = assembly.Version
|
||||
assembly.Name,
|
||||
assembly.Version
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core.Web
|
||||
{
|
||||
return new
|
||||
{
|
||||
Key = device.Key,
|
||||
device.Key,
|
||||
Name = (device is IKeyName)
|
||||
? (device as IKeyName).Name
|
||||
: "---"
|
||||
|
||||
Reference in New Issue
Block a user