Hi! I'm trying to learn a bit about APIs but not getting very far. Can anyone help me?
I had a browse for some APIs I could mess around with and decided to use this one as it seemed to have a lot of documentation. Free Public football API
. I'm struggling to get my code to work with it however. Currently I am only trying to check that I can connect to it without errors... but I can't even get past the first hurdle. I looked over a few blogs on the subject but I'm still not sure where I'm going wrong.
This is my codeunit
procedure GetAPIData(Endpoint: Text; Header1Value: Text; Header2Value: Text)
//Uri := Endpoint + APIKey;
Uri := Endpoint;
if HttpClient.Get(Uri, HttpResponse) then
// HttpResponse.Headers().Add(Header1, Header1Value);
// HttpResponse.Headers().Add(Header2, Header2Value);
if HttpResponse.IsSuccessStatusCode() then begin
but I am getting this error
Has anyone any idea of what I'm doing wrong? Or any links to good blogs that explains the process in simple terms?