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

Unable to send form data type request from business central

(0) ShareShare
ReportReport
Posted on by 107
Hi All,
Please help me, I am unable to send request to rest api facing issue but from post man its working
if
       
         CR
:= 13;
        LF := 10;
        NewLine += '' + CR + LF;

        // Request.GetHeaders(ContentHeaderL);

        TempBlob.CreateOutStream(PayloadOutStream);
       PayloadOutStream.WriteText('Content-Disposition: form-data; name="NAME"' + NewLine);
        PayloadOutStream.WriteText(NewLine);
        PayloadOutStream.WriteText('Eric TestWS' + NewLine);
        PayloadOutStream.WriteText('multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' + NewLine);
        PayloadOutStream.WriteText(NewLine);
        TempBlob.CreateInStream(PayloadInStream);
        // Write all bytes from the request body stream.

        Content.WriteFrom(PayloadInStream);
        Content.GetHeaders(ContentHeaderL);
        ContentHeaderL.Clear();
        ContentHeaderL.Add('Content-Length', '4096'); // this is required I think but when I keep this line request is aborting otherwise is request is success with error in response
        ContentHeaderL.Add('Content-Type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
        ContentHeaderL.Add('X-Kount-Api-Key', 'tokenvalue');

        Request.Method := 'POST';
        Request.SetRequestUri('https://risk.test.kount.net');
        Request.GetHeaders(Requestheaders);
        Requestheaders.Clear();
        Requestheaders.Add('Host', 'risk.test.kount.net');
        Request.Content(Content);
        Client.Send(Request, Response);


I have the same question (0)
  • Suggested answer
    Mahesh U Profile Picture
    433 on at

    Hi Venkatesh,

    At what line the debugger is stopping while getting this error? 

    Try to change the length from hard coded to using actual length and try. Thanks!

  • Venkateshwar_Indian Profile Picture
    107 on at

    client.send(request,response).

    if I dont put content length then post man response and business central response is same, when I use content length in post man request is successful but in bc it is failing with below error message

  • Verified answer
    Venkateshwar_Indian Profile Picture
    107 on at

    Hi Mahesh.

    As you told in Linkedin, for content type instead of giving value as direct number, taken value from tempblob.length it resolved the issue

    Thanks,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,024 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,145 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 705 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans