AL code has an error message 'The format of value '1:e6c6699e-aa52-4cdc-b493-7f097fa53a9f' is invalid.'
I got following screenshot's error message when run following AL codes.

`procedure GetToken() responseText: Text
var
strUrl: Text;
client: HttpClient;
reqHeaders: HttpHeaders;
request: HttpRequestMessage;
response: HttpResponseMessage;
begin
strUrl := 'https://APIAddress/token';
request.SetRequestUri(strUrl);
reqHeaders.Clear();
request.GetHeaders(reqHeaders);
request.Method := 'GET';
reqHeaders.Add('authorization', '1:e6c6699e-aa52-4cdc-b493-7f097fa53a9f');
client.Send(request, response);
response.Content().ReadAs(responseText);
end;`
According to the error message, it is showed when executing AL code ' reqHeaders.Add('authorization', '1:e6c6699e-aa52-4cdc-b493-7f097fa53a9f');' It seems this issue is occured by 'authorization' key's value has special symbol colon ':'. Could anyone please help me how to resolve this colon issue?
Does the code work when using the .NET HTTP client? What are the solutions there?
Hi @atoader , yes, it works on .NET HTTP client. I want to call our web api and get token value through using AL HTTP client, but it throwed error message when add authorization value into HTTP header.
@monchangg can you post the C# code that achieves the same goal you are trying to achieve in AL?
@atoader Following is my C# code. `public string GetToken() {
string path = @"https://APIAddress/token";
HttpWebRequest request;
HttpWebResponse response;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
request = WebRequest.Create(path) as HttpWebRequest;
request.Method = "GET";
request.KeepAlive = true;
request.Accept = @"application/json";
request.Headers.Add("authorization", "1:e6c6699e-aa52-4cdc-b493-7f097fa53a9f");
response = (HttpWebResponse)request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
string result = reader.ReadToEnd();
stream.Close();
return result;
}`
Hi @atoader , do you have any solutions for my issue?
Hi @atoader , can you please help me to look into my issue? I'm still waiting for your response.
I apologize for the delay @monchangg! The AL HTTP classes are based on types in this namespace https://docs.microsoft.com/en-us/dotnet/api/system.net.http?redirectedfrom=MSDN&view=netframework-4.7.2 . The proper way to achieve this with HttpRequestMessage is to use TryAddWithoutValidation or by using TryAddWithoutValidation. I have opened a bug so that we add this for a future release.
Hi @atoader , Thanks for your feedback. Could I know the release plan for fixing this issue?
The fix for this issue has been checked in to the master branch. It will be available in the bcinsider.azurecr.io/bcsandbox-master Docker image starting from platform build number 27922.
If you don’t have access to these images you need to become part of the Ready2Go program: aka.ms/readytogo
For more details on code branches and docker images please read: https://blogs.msdn.microsoft.com/nav/2018/05/03/al-developer-previews-multiple-releases-and-github/ https://blogs.msdn.microsoft.com/freddyk/2018/04/16/which-docker-image-is-the-right-for-you/