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

NAVHttp Client Request Failed

(0) ShareShare
ReportReport
Posted on by 55

Hi Team,

While processing an external API in BC, I get the status code 0 and response "NavHttp Client Request Failed".

But while I am calling same uri in Postman, I get a proper response and status code is 200.

Can you please advise on this,

Thank you for your help!

.issue1.png

pastedimage1631447854419v2.png

Thank you

Regards

Revanth

I have the same question (0)
  • Suggested answer
    Andrey Baludin Profile Picture
    3,941 on at

    Hi Revanth,

    there is no httpStatus 0. This is default value and this means that server do not responds to you at all. This could be timeout issue, incorrect URL or some missed header in request - a lot of reasons.

    Please share the full URL. I see that it looks just like picture download with anonymous auth and I think this is not a big secret?

  • RevanthM Profile Picture
    55 on at

    Hi @Andrey,

    Here is the url - static.grainger.com/.../19YH59_AS01

    Thank you for your help!

    Regards

    Revanth M

  • Verified answer
    Andrey Baludin Profile Picture
    3,941 on at

    In the headers of Postman request which works you can see extra hidden headers including "Accept" : '*\*'

    pastedimage1631537539759v1.png

    So just add this to your request and it works :

    local procedure testImageDownload()
        var
            Client: HttpClient;
            ResponseMessage: HttpResponseMessage;
            Headers: HttpHeaders;
            ResponseText: Text;
        begin
            ResponseText := '';
    
            Headers := Client.DefaultRequestHeaders;
            Headers.Add('Accept', '*/*');
            if not Client.Get('https://static.grainger.com/rp/s/is/image/Grainger/19YH59_AS01?$S7PRODUCT$', ResponseMessage) then
                Error('Not ok');
    
            ResponseMessage.Content().ReadAs(ResponseText);
    
            if not ResponseMessage.IsSuccessStatusCode() then
                ResponseText := StrSubstNo('%1 %2', ResponseMessage.HttpStatusCode(), ResponseText);
    
            Message(ResponseText);
        end;

  • RevanthM Profile Picture
    55 on at

    Thank you very much @Andrey.

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,226

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,047 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,257 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans