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>
<RepositoryUrl>https://github.com/C9Glax/CShocker</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Version>1.3.7</Version>
<Version>1.3.8</Version>
</PropertyGroup>
<ItemGroup>

View File

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