NavBC: httpclient error when get data

golfdukdikgolfdukdik Member Posts: 4
Hi all,

I can't get data from api url.

anyone can help me ?

my code as below

procedure StartBOTT_API();
var
Client: HttpClient;
HttpRespone: HttpResponseMessage;
ResponseText: Text;
Url: Text;
begin

Url := 'https://api.exchangeratesapi.io/latest';
Client.Get(Url, HttpRespone);

end;


=========
when run this code

tfxtlsr99hxc.jpg




I'm using dynamics 365 business central 15.0.36560.0

Best Answer

Answers

  • golfdukdikgolfdukdik Member Posts: 4
    Hi ftornero,

    Thanks for your reply

    I'm already to allow httpclient and use your code but get same error :'(
    wwolb6uv4xdt.jpg

    I try to debug my code is break at this point
    oh06lq25z4jh.jpg

    Do you have any recommendations?

  • ftorneroftornero Member Posts: 524
    Hello @golfdukdik ,

    Have you tried to call the URL from a browser ?

    z11j96dykuim.png

    What is your environment (docker, local installaction, etc.) ?

    Regards
  • golfdukdikgolfdukdik Member Posts: 4
    edited 2020-05-18
    Hi @ftornero

    Yes, I can call data from browser.

    k2spoacw2pxm.jpg

    I using docker environment
  • ftorneroftornero Member Posts: 524
    Hello @golfdukdik,

    And the docker container has the port 443 open.

    f120veuspj3n.png

    Regards.
  • golfdukdikgolfdukdik Member Posts: 4
    Hi @ftornero

    I try to use environment on localhost is works. :smiley:

    I think my docker is broken

    thank you very much for your help

Sign In or Register to comment.