You need to sign in to do that
Don't have an account?
Ab
Apex API code for token with basic authentification (username )
Hello,
I want to get a token from the end point:
For passing parameters in end point i have Authorization, Header and Body.
Ho can i write the code for the Authorization part, Authorization type = basic, User name and password, etc
I already have written code for header and body
thank you for suggestion !
I want to get a token from the end point:
For passing parameters in end point i have Authorization, Header and Body.
Ho can i write the code for the Authorization part, Authorization type = basic, User name and password, etc
I already have written code for header and body
thank you for suggestion !
Try to add the below lines for auth header.
HTTPRequest req = new HTTPRequest();
Blob headerValue = Blob.valueOf(username+':'+password);
String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
req.setHeader('Authorization', authorizationHeader);
Thanks,
Maharajan.C