Skip to content

AL HttpRequest /Httpclient "Get" Method with Key Content-Type #4097

@sankarvinop

Description

@sankarvinop

Bug
Key "Content-Type" unable to add to HttpHeaders if we get http headers from HttpRequestMessage.Get(Headers).

Steps and/or AL code to reproduce the behavior:

  1. Go to '...'
    Create functions and local variables
    Headers : HttpHeaders;
    RequestMessage : HttpRequestMessage ;

Add code.

RequestMessage.GetHeaders(Headers);
RequestHeaders.Add('Content-Type','application/x-www-form-urlencoded');

and try to call this function from BC. it will hit an error while adding key.

Expected behavior
As per standard content-type, it must be added into HttpContent. but some of the API calls, we need to add this into part of header. because other system expect content-type key from header. if not exisit will simply rejects.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions:
AL Verison: 2.0.28254

  • Business Central: W1 version

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigateThe issue requires further investigation to determine if this is a product bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions