Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. public void APICALL()
  2. {
  3.  
  4. HttpRequest req = new HttpRequest();
  5. String endPointURL = 'https://abcwerr.ffff.com/v2/ttttt';
  6. String userName = 'BlahBlah';
  7. String password = 'BlahBlah';
  8. Blob headerValue = Blob.valueOf(userName + ':' + password);
  9. String authorizationHeader = 'Basic' +
  10. EncodingUtil.base64Encode(headerValue);
  11. req.setEndpoint(endPointURL);
  12. req.setHeader('Content-Type', 'multipart/form-data');
  13. req.setHeader('Authorization',authorizationHeader);
  14. req.setMethod('POST');
  15. string bdy = 'merchant_url='+ AppForm.Business_Website__c;
  16.  
  17. req.setbody(EncodingUtil.base64Encode(bdy));
  18. Http http = new Http();
  19.  
  20. HTTPResponse res = http.send(req);
  21. this.SpiderResponse = res.getBody();
  22. }
  23.  
  24. Blob headerValue = Blob.valueOf(username + ':' + password);
  25. String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
  26. r.setHeader('Authorization', authorizationHeader);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement