Send JSON body in HTTP request
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2021-11-04 08:50 AM
‎2021-11-04
08:50 AM
Hi,
I am trying to send data in JSON format in an HTTP request like this:
GS::UniString uriString = "https://domain/api";
IO::URI::URI connectionUrl(uriString);
ClientConnection clientConnection(connectionUrl);
GS::ObjectState requestOs;
requestOs.Add("param1", "val1");
requestOs.Add("testKey2", "val2");
JSON::CreateFromObjectState(requestOs, clientConnection.BeginSend(request));
clientConnection.FinishSend();
But I am not receiving the JSON in the request on the server side (PHP).
Is this the correct way to send JSON data in an HTTP request?
Please help! ( @Tibor Lorantfy ? )
Thanks.
Labels:
- Labels:
-
Add-On (C++)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2023-01-24 05:46 PM
‎2023-01-24
05:46 PM
You are probably missing a
clientConnection.Connect();
right after you initialized clientConnection.