web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Set body content for POST request

(0) ShareShare
ReportReport
Posted on by 95

Hello community,

I am trying to send a post request.

I need to send JSON data in the body, so I am trying to put my JSON content into a Text variable and trying to pass it to the HTTPClient.POST method (in its 2nd parameter).

When in AL (Visual Studio) editor I paste my JSON content between the 2 single quotations I get an error (red line beneath by entire JSON text).

..
Var
MyContent: Text;
Begin
..
..
MyContent:= '{
	"subject": "Something Here",
	"expiresIn": "15m",
	"private_key": "-----BEGIN PRIVATE KEY-----Something Here-----END PRIVATE KEY-----",
	"issuer": "Something Here"
}'
..
HTTPClient.POST(..,MyContent,..)

Comunity.PNG

Not sure how to set my Content for sending a POST request in AL.

Thank you in advance for the advice!

I have the same question (0)
  • Verified answer
    Mesam Profile Picture
    95 on at

    This was fixed, had to remove all the spaces!

  • Suggested answer
    Marco Mels Profile Picture
    on at

    Thank you for sharing!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans