Closed obychyk closed 8 months ago
Versions of BC tested on:
I have raised the concern internally, so I cannot guarantee if or when it will be addressed.
I have raised the concern internally, so I cannot guarentee if or when it will be addressed.
/ Let's get the issue to a team who will fix and backport it, as this repository is only for issues related to the AL compiler in latest developer preview environment for Dynamics 365 Business Central. We suggest that you open a support case or file a bug in Collaborate, to ensure that all Business Central users benefit from your catch as soon as possible.
To open a support case, you can:
If you file the bug in Collaborate, remember to include steps to reproduce the issue, and the Business Central build number and country version you're using.
Describe the issue
HttpContent
can't be initialized usingClear()
method. When trying to send a request to a server I useHttpContent
to initializeHttpHeaders
and body of the request. Here is the code snippet:Based on description of method
Clear()
here, the method would initializeHttpContent
object to default values.This code snippet works as expected in local container environment (both
OnPrem
andSandbox
), however, when deployed to SaaS version - lineRequest.Content.GetHeaders(Headers);
(inside of theif
statement) returns an error:Expected behavior
Method
HttpContent.Clear()
would initialize a default object ofHttpContent
which can be later used for further processing.Steps to reproduce
See the provided code snippet
Additional context
I was able to overcome the issue using the following code snippet:
So instead of
Content.Clear()
I usedContent.WriteFrom('')