Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. HTTP h = new HTTP();
  2. HTTPRequest r = new HTTPRequest();
  3. r.setEndpoint('https://my.domain.com');
  4. Blob headerValue = Blob.valueOf(username + ':' + password);
  5. String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
  6. r.setHeader('Authorization', authorizationHeader);
  7. r.setMethod('GET');
  8. HTTPResponse resp = h.send(r);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement