You need to sign in to do that
Don't have an account?
Keith Stephens 18
callouts rest services
Needing help to get Case information to my C# rest service.
Below is my code, but I am getting "Bad Request" error.
I am not sure what I need to do to get my query results to my service for reading.
Thanks,
KS
Below is my code, but I am getting "Bad Request" error.
I am not sure what I need to do to get my query results to my service for reading.
Thanks,
KS
String Soql = 'SELECT LastModifiedDate,Plaintiff_Full_Name__c,Plaintiff_Last_Name__c FROM Case limit 3'; List<sObject> L = Database.query(Soql); String url = 'http://server/ErpApiService/api/PriceForCustomerB/' + L; System.Debug(url); Http h = new Http(); HttpRequest req = new HttpRequest(); system.debug('got request'); req.setHeader('Content-Type', 'application/json'); req.setEndpoint(url); system.debug('setendpoint'); req.setMethod('GET'); HttpResponse res = h.send(req); system.debug('res' + res); system.debug('Price: ' + res.getBody());
Did you add the api in remote site settings?
If I just pass back a string in the case below the number 5 it works fine, but when I try to pass my query results I get a bad request error.
String url = 'http://myserver/ErpApiService/api/PriceForCustomer/5';