You need to sign in to do that
Don't have an account?
Abraham kumar 4
To Give non array output
I need to below code to give non array output currently it is sending a rest callout with []. i dont want the array [] just plain output {...}.. pls help to correct this code. it just needs to send the data without the brackets[]. Please help . Many Thanks!!
public class WebServiceCallout { @future (callout=true) public static void sendNotification(string Id,string Email,string First_Name,string Last_Name,string phone,string Title,string Account) { conweb cont=new conweb(Id,Email,First_Name,Last_Name,Phone,Title,Account); list<conweb> conwebs=new list<conweb>(); conwebs.add(cont); HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); req.setTimeout(2000); // timeout in milliseconds req.setEndpoint('http://requestb.in/1cwgm6y1'); req.setMethod('POST'); req.setHeader('Content-Type','application/json'); req.setHeader('Authorization','gfkj^%$654GF65yhtd54'); req.setBody(JSON.serialize(conwebs)); try { res = http.send(req); } catch(System.CalloutException e) { System.debug('Callout error: '+ e); System.debug(res.toString()); } } public class conweb { String salesForceId; String emailAddress; String firstName; string lastName; string contactNumber; string jobTitle; string companyName; public conweb(string sid,string semail,string sfirstname,string slastname,string sphone,string Title,string Account) { salesForceId=sid; emailAddress=semail; firstName=sfirstname; lastName=slastname; contactNumber=sPhone; jobTitle=Title; companyName=Account; } }}
Abhi_Tripathi
Already resolved on https://developer.salesforce.com/forums/ForumsMain?id=906F0000000BMClIAO