
And this works and calls my rest service passing in a string value, but now I want to pass back some actual data from salesforce example'SELECT LastModifiedDate,Plaintiff_Full_Name__c,Plaintiff_Last_Name__c FROM Case limit 3';I know I will have to change my parameter in my rest service to accept whatever SF will be passing to me.But here I am not sure what or how to do this? Do I need to create a dictionary object, and pass that?What do I need to do in SF to pass query results and then read them in my rest service.Thanks for any help or advice,Keith.String url = 'http://server/ErpApiService/api/PriceForCustomerA/10/15';
Http h = new Http();
HttpRequest req = new HttpRequest();
system.debug('got request');
req.setEndpoint(url);
system.debug('setendpoint');
req.setMethod('GET');
HttpResponse res = h.send(req);
system.debug('res' + res);
system.debug('Price: ' + res.getBody());
2 respostas

Hello All,Just as fyi what I got to work was. I had to serialize my soql my list<sobjects>Chage the GET to Postadd setBody equal to my serialized List.Then on the C⌗ side I had to change my Get call to a Post and add async to the method.Then I could do string result = await Request.Content.ReadAsStringAsync(); To get my json string.