Problem sending JSON with HTTPSocket.Get

I am trying to send data a user fills out on a support page to our server so it can be logged. All the data goes into a JSON item which I then send as a JSON.ToString to a PHP script on our server using a synchronous HTTPSocket.Get. If I copy the urlString and paste it into a browser, the PHP script runs and the data is logged. When Xojo sends the same urlString, the JSON string truncates at the first space. I know this because the PHP script logs the GET string as the first thing it does after sending an ‘a’ character.

The fix appeared to be to replace all the spaces with %20. Sending the urlString through a browser still works, but when the urlString is sent by Xojo, the PHP program does not log anything for its GET input and nothing is returned, not even the ‘a’ that is sent in the first line of code in the PHP script. The JSON string I am working with is 662 characters long and I am worried that Xojo can’t handle that long a command.

Problem solved by using CurlMBS

The HTTPSocket class does not send an entity body with GET requests; this client-side behavior is recommended by the HTTP specification, but most servers won’t reject such a request.

If you control the PHP server program then you may want to consider a different HTTP request method such as POST or PUT, since the semantics of a JSON-upload request do not imply a retrieval like GET does.