I’m building a site that requires data from an external API. I have two questions:
- What’s the best way/is there a way to make HTTP requests using Hugo?
- The API also requires me to append a querystring at the end of the URL of pages that want to render content that requires data from the API. Is there a way to do this? I see the
querify function is available, but the given example is for an external URL.
I don’t think Hugo itself will make API calls for you. It can however read from data files and you can create them in any way you see fit.
Thanks for the reply!
Any idea about the querystring at the end of URL’s?
I see two possible paths:
You create a cron job to run a build script regularly and create the data files via the api.
If you need the querystring information, then this second may be a better option.