HTTP Api - Can't access using domain name

I am trying to create a Delphi ROSDK HTTP Api REST server.

I am able to access the rest endpoints just fine when on localhost, but when I try to attach to a domain name using the OnManualBind event of the server I get the following error from the Swagger editor

“TypeError: NetworkError when attempting to fetch resource.”

I have tried different things in the OnManualBind. My current code is:

procedure TServerDataModule.ROWinHttpServer1ManualBind(Sender:
TObject);
begin
ROWinHttpServer1.Server.AddUrl( ‘http://localhost:80/’, True );
ROWinHttpServer1.Server.AddUrl( ‘http://localhost:80/rest/’, True );
ROWinHttpServer1.Server.AddUrl( ‘http://api.angelictech.com:80/’, True );
ROWinHttpServer1.Server.AddUrl( ‘http://api.angelictech.com:80/rest/’, True );
end;

Not sure what the issue is at this point.

Ok, the issue I was having is that I needed to enable SSL for the domain.

Yeah, TLS certificates are tied to the host name(s), they won’t just work with an arbitrary address.

The problem is that Swagger Editor wasn’t able to call a non ssl url (except localhost). It was trying to use https for the domain name.

1 Like

Hi,

You can use CURL for testing