I’m trying to make the most simple API call to the IC’s via HTTPS interface. But when I try the following for some reason it downloads a file: https://ic0.app/api/v2/status/ Is this endpoint wrong or does it need some parameters?
You can make pure HTTPS calls (e.g. from curl), but there are some caveats.
For the moment only query calls are possible (no updates).
You will need to implement a function called http_request in your capsule, and add the needed logic there. I haven’t done it in motoko yet, but here’s a barebones rust example that I tested a while ago:
Do you have an example of simple query call like a GET call that could be done via in a browser without additional coding? For example, calling/querying the following API endpoint from a browser gives you a list of all country info in a database: https://restcountries.eu/rest/v2/all
IC API calls via the HTTPS interface can be called from anywhere that https calls can be made. this endpoint: /api/v2/status/ is a correct one but it gives back bytes that are in a cbor-coding. You can check out this document for the full HTTPS api and for the encodings/decodings of the requests/responses of the endpoints: The Internet Computer Interface Specification :: Internet Computer