Making Http Calls #2
Answered
by
daveaglick
isaacrlevin
asked this question in
Q&A
-
Is this supported in Statiq? Say for instance I wanted to query an api to get some data and put it in a view. Would I have to do that in javascript? |
Beta Was this translation helpful? Give feedback.
Answered by
daveaglick
Jun 15, 2020
Replies: 2 comments 1 reply
-
Yep, in fact there's even some helper stuff specifically for API use cases:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
isaacrlevin
-
I am trying to call the tumblr api and get the content of my posts. Is there a guide on how to make http calls with statiq? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yep, in fact there's even some helper stuff specifically for API use cases:
EvaluateScript
orExecuteConfig
(basically any time you have access to the execution context), you can callIExecutionContext.CreateHttpClient()
to get aHttpClient
instance. This will do similar pooling and management for you like ASPNET Core does.ReadWeb
module: https://github.com/statiqdev/Statiq.Framework/blob/main/src/core/Statiq.Core/Modules/IO/ReadWeb.cs