Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I am trying to make an API call using TRestClient to get the access token by passing a Base 64 encoded string as header, I am struggling in Base 64 Encoding and passing the value to header
Please anyone help
You can encode and decode using a bit of Java. Here is a "Hello World" example that you can run in a tJava to test....
String body = "Hello world";
//Encoding
java.util.Base64.Encoder encoder = java.util.Base64.getEncoder();
byte[] bufEnc = encoder.encode(body.getBytes());
String strEnc = new String(bufEnc, java.nio.charset.StandardCharsets.UTF_8);
System.out.println(strEnc);
//Decoding
java.util.Base64.Decoder decoder = java.util.Base64.getDecoder();
byte[] bufDec = decoder.decode(strEnc.getBytes(java.nio.charset.StandardCharsets.UTF_8));
String strDec = new String(bufDec, java.nio.charset.StandardCharsets.UTF_8);
System.out.println(strDec);
Hello @not specified not specified ,
Here is online tools for base64 encode and decode which may help you
https://www.base64encode.net/