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

Announcements

No record found.

News and Announcements icon
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!

  • Verified answer
    Mesam Profile Picture
    95 on at

    This was fixed, had to remove all the spaces!

  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 748 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 354 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 351 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans