Skip to content

Making Http Calls #2

Answered by daveaglick
isaacrlevin asked this question in Q&A
Jun 15, 2020 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Yep, in fact there's even some helper stuff specifically for API use cases:

  • If you're writing your own module, or writing code for extensibility modules like EvaluateScript or ExecuteConfig (basically any time you have access to the execution context), you can call IExecutionContext.CreateHttpClient() to get a HttpClient instance. This will do similar pooling and management for you like ASPNET Core does.
  • If you just want to get data from an API you can consider using the ReadWeb module: https://github.com/statiqdev/Statiq.Framework/blob/main/src/core/Statiq.Core/Modules/IO/ReadWeb.cs
  • Eventually (hopefully before too long), I'll also add some API support directly to Statiq Web so that you…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by isaacrlevin
Comment options

You must be logged in to vote
1 reply
@daveaglick
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants