• Mahesh Sirmewar
  • 10 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 0
Hi All,

I want to built a mashup between Salesforce and the SIMILE Timeline. Can any one please help me for this.
How to create salesforce offline app which allow user to Offline access to Salesforce data also insert data off-line &  once client will online then data will automatically sync with salesforce.
I am developing a batch class to make api calls and get data from that api in to salesforce. I need to send http request by post method, with user name & password as header. I have tried but i got error. Can anyone please help me to do this. Below is my code please check it. (Error:Invalid Request error was encountered while trying to process the request)

HttpRequest req= new HttpRequest();
String username = 'ABC';
String password = 'Sales123';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
Http http = new Http();
String url = 'http://XYZ';
req.setEndpoint(url );
HttpResponse res = http.send(req);
return res.getBody();