Thank you @nawab69 for your contribution!.
- I can see you are wrapping APIs upon the official full node - which you might want to extract that into a common configuration - if the node fails, you may want to have a fall-over mechanism to try next one.
- The header should really be before your echo. Otherwise, depending on network latency, sometimes the browsers may have a warning.
- Your APIs are not unit tested - could be good to have some tests
- You don't need the
?>
which is recommended in API, otherwise, you might accidently put extra blank lines after - which will be valid HTML outputs, and you don't want that. - Your
curl
code could be extracted into a function/class - this is to remove code duplication in your APIs.
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Chat with us on Discord.
Thank you for your review, @justyy! Keep up the good work!