WebHooks CustomHttpHeaders character '-' Json parse error

Options
CustomHttpHeaders ->
{"X-LC-Id": "jrWMQD2HODqMHNVxxxxxxx-xxxxxxx","X-LC-Key": "M7bggCxFz1sUrtlxxxxxxxxxx","Content-Type": "application/json"}




Operation 226 failed in a server-side plugin. Check the configuration in the Dashboard. Message from server-plugin: Newtonsoft.Json.JsonReaderException : Invalid JavaScript property identifier character: -. Path '', line 1, position 2.
Stack Trace:
at Newtonsoft.Json.JsonTextReader.ParseUnquotedProperty()
at Newtonsoft.Json.JsonTextReader.ParseProperty()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CheckedRead(JsonReader reader)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Photon.Hive.Plugin.WebHooks.WebHooksPlugin.SetupInstance(IPluginHost host, Dictionary`2 config, String& errorMsg) in d:\dev\photon-socketserver-sdk_cloud\src-server\Plugins\WebHooks1.2\WebHooksPlugin.cs:line 441
at Photon.Hive.Plugin.WebHooks.PluginFactory.Create(IPluginHost gameHost, String pluginName, Dictionary`2 config, String& errorMsg) in d:\dev\photon-socketserver-sdk_cloud\src-server\Plugins\WebHooks1.2\PluginFactory.cs:line 10
at Photon.Hive.Plugin.PluginManager.CreatePluginWithFactory(IPluginHost sink, String pluginName) in d:\dev\photon-socketserver-sdk_cloud\src-server\Hive\PhotonHive\Plugin\PluginManager.cs:line 476
at Photon.Hive.Plugin.PluginManager.GetGamePlugin(IPluginHost sink, String pluginName) in d:\dev\photon-socketserver-sdk_cloud\src-server\Hive\PhotonHive\Plugin\PluginManager.cs:line 213

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited November 2017
    Options
    Hi @Dillon,

    Thank you for choosing Photon!

    How do you set "CustomHttpHeaders"? did you try escaping \" characters?

    I have tested this on Photon Cloud and it works as expected.
    Also, unrelated to this issue, you should remove "Content-Type" as we ignore/skip that and any reserved HTTP headers.
  • Dillon
    Options
    Thank you for your reply, the problem is solved.
    but there is a new question, how should I get the number and details of the player in the current room, did not receive any parameter information after receiving the post request
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    the problem is solved.
    Can you share how? What was wrong?

    but there is a new question
    Start a new forum topic.
  • Dillon
    Options
    The first problem is due to our server configuration error, the second is because the incoming parameters are not clear, such as when I did not set a nickname when the parameter is not passed over