Fi xjson message string

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

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);