Fi xjson message string

This commit is contained in:
glax 2024-01-28 18:25:33 +01:00
parent 4b19a9f434
commit ed4eb644a0
2 changed files with 10 additions and 9 deletions

View File

@ -7,7 +7,7 @@
<Authors>Glax</Authors> <Authors>Glax</Authors>
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl> <RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<Version>1.3.7</Version> <Version>1.3.8</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -63,15 +63,16 @@ public class OpenShockHttp : HttpShocker
UserAgent = { new ProductInfoHeaderValue("CShocker", "1") }, UserAgent = { new ProductInfoHeaderValue("CShocker", "1") },
Accept = { new MediaTypeWithQualityHeaderValue("application/json") } Accept = { new MediaTypeWithQualityHeaderValue("application/json") }
}, },
Content = new StringContent("{ shocks: ["+ Content = new StringContent("{" +
"{ "+ "\"shocks\": ["+
$"\"id\": \"{shockerId}\"," + "{"+
$"\"type\": {ControlActionToByte(action)},"+ $"\"id\": \"{shockerId}\"," +
$"\"intensity\": {intensity},"+ $"\"type\": {ControlActionToByte(action)},"+
$"\"duration\": {duration}"+ $"\"intensity\": {intensity},"+
"}" + $"\"duration\": {duration}"+
"}" +
"]," + "]," +
"customName: CShocker" + "\"customName\": CShocker" +
"}", Encoding.UTF8, new MediaTypeHeaderValue("application/json")) "}", Encoding.UTF8, new MediaTypeHeaderValue("application/json"))
}; };
request.Headers.Add("OpenShockToken", ApiKey); request.Headers.Add("OpenShockToken", ApiKey);