My application is in PHP, and due to the lack of clients for SocketIO with support for V4.0 I am creating internal functions that connect via cURL to emit events from my application to the Socket.IO server that I have.
So far everything is going fine, when I just need to set the server event name and a basic sent value.
Like the example below:
For double quotes I realized that I have to always put two \ in front of the quote to be accepted by SocketIO. Are there any other rules that must be followed when performing this procedure?
My application is in PHP, and due to the lack of clients for SocketIO with support for V4.0 I am creating internal functions that connect via cURL to emit events from my application to the Socket.IO server that I have.
So far everything is going fine, when I just need to set the server event name and a basic sent value. Like the example below:
CURLOPT_POSTFIELDS => '42["eventNameOnServer","My Value."]'
My problem is occurring when I try to send a JSON, such as
{"id":1,"value":"String"}.
CURLOPT_POSTFIELDS => '42["eventNameOnServer","{\\"id\\":1,\\"value\\":\\"String\\"}."]'
For double quotes I realized that I have to always put two \ in front of the quote to be accepted by SocketIO. Are there any other rules that must be followed when performing this procedure?