POST request for load_data

load_data allows to make a GET request for example to a json API.

Is there a way to use it for a POST request for example to a GraphQL API?

1 Like

Not right now but that shouldn’t be hard to add it to the function. On the other hand, writing a graphql query in a template doesn’t sound fun

Hi,

i have a usecase for post requests as well and have some time this week.

I was thinking something along these lines:

{% set postdata = load_data(url="https://postman-echo.com/post", 
										format="json", 
										method="POST", 
										body="{test:'teststr'}", 
										content-type="application/json")%}

so that would be 3 new parameters.
when method=POST is set an optional content-type and body will be added the the POST request.

Is this something you would want added to zola, @keats?
I’d be willing to give it a go.