This might be a simple one.
I\'m accessing a RESTFul service with Delphi XE6 using RestClient components: TRestClient, TRestRequest, TRestResponse and THTTPBasicAuth
Done! It looks like I was doing it the wrong (or complicated) way. The service was expecting a JSON object and I was building it property by property. There is an easier way:
var aParam: TRESTRequestParameter;
begin
RestReq.Method := rmPOST; {or rmGET, ...}
aParam := RestReq.Params.AddItem(); //don't care about setting a name for it
aParam.Value := TJSONObject.ParseJSONValue('{"param1":"value1","param2":"value2","param3":["v1","v2","v3"]}');
aParam.ContentType := ctAPPLICATION_JSON;
//set proxy params, resource, etc.
RestClient.Execute();
end;
And that will do! Thanks all for your comments.