Skip to content

procedure Create(Content: SecretText; ContentType: Text) HttpContent: Codeunit "Http Content" fails #8017

@KosPav

Description

@KosPav

Please include the following with each issue:

1. Describe the bug
when i use one of procedures below in codeunit 2354 "Http Content":

  • procedure Create(Content: SecretText) HttpContent: Codeunit "Http Content"

  • procedure Create(Content: SecretText; ContentType: Text) HttpContent: Codeunit "Http Content"

i receive an error:

If requesting support, please provide the following details to help troubleshooting:

Error message:
Invalid HTTP header. Please, make sure the format of the header is correct.

Internal session ID:
d3c21ffd-5530-410f-b64a-bfe25c57fb34

Application Insights session ID:
01008877-fada-476d-a44a-afa2167f5941

Client activity id:
74bd7d9f-75bf-1989-0899-d84db72ffb34

Time stamp on error:
2025-04-17T11:29:07.4678073Z

User telemetry id:
6fcf9d3d-cb90-4009-a829-cf0ffb205517

AL call stack:
"Http Content Impl."(CodeUnit 2355).SetHeader line 12 - System Application by Microsoft
"Http Content Impl."(CodeUnit 2355).SetContentTypeHeader line 4 - System Application by Microsoft
"Http Content Impl."(CodeUnit 2355).SetContent line 6 - System Application by Microsoft
"Http Content"(CodeUnit 2354).SetContent line 2 - System Application by Microsoft
"Http Content"(CodeUnit 2354).Create line 2 - System Application by Microsoft
"Http Content"(CodeUnit 2354).Create line 2 - System Application by Microsoft
"SQL Sync Step Setup"(Page 72114)."test2 - OnAction"(Trigger) line 8 - MS Foundation by Kappi ehf.

2. To Reproduce

            action(test2)
            {
                trigger OnAction()
                var
                    HttpContent: Codeunit System.RestClient."Http Content";
                    t: Text;
                    s: SecretText;
                begin
                    t := 'test';
                    s := t;
                    HttpContent.Create(s);
                end;
            }

3. Expected behavior
No error should happen

4. Actual behavior

Image

5. Versions:

  • AL Language: 14.3.1327807
  • Visual Studio Code: 1.99.2 (user setup)
  • Business Central: IS Business Central 25.5 (Platform 25.2.32025.0 + Application 25.5.30849.32073)
  • Operating System: Windows_NT x64 10.0.26100

6. Recomendation:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions