You need to sign in to do that
Don't have an account?
trick012
Rest API
Hi Friends,
Can somebody please explain me what is happening in the below given lines.
What is header and why do we use it.?
What does this EncodingUtil.base64Encode does?
What is the use of Blob.valueof()?.
String username = 'myname';
String password = 'mypwd';
Blob headerValue = Blob.valueOf(username + ':' + password);
String authorizationHeader = 'BASIC ' +
EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
Thanks,
Trick
Check out wikipedia: http://en.wikipedia.org/wiki/Basic_access_authentication
That may help explain things.