Advertisement
Guest User

Untitled

a guest
May 20th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. String endPointURL = 'https://api.boomi.com/api/rest/v1/AccountID/EnvironmentExtensions/XXXXXXXXXX';
  2.  
  3. String userName = 'XXXXXX';
  4. String password = 'XXXXXXX';
  5.  
  6. String body= '';
  7. String query;
  8. query = '';
  9. Blob headerValue = Blob.valueOf(userName + ':' + password);
  10. String authorizationHeader = 'BASIC ' +
  11. EncodingUtil.base64Encode(headerValue);
  12. accs1 = new List<cAccount>();
  13. Httprequest request = new HttpRequest();
  14. Http http = new Http();
  15. request.setMethod('POST');
  16. request.setEndpoint(endPointURL);
  17. request.setHeader('Content-Type', 'application/json');
  18. // Header info with remote server user name and password
  19. request.setHeader('Authorization', authorizationHeader);
  20. request.setBody(query);
  21.  
  22. request.setTimeout(120000);
  23. request.setBody(query);
  24. //Making call to external REST API
  25. HttpResponse response = http.send(request);
  26. System.debug('responseBody: '+response.getBody());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement