Photo of Gary Holeman


Forming body of Lava webrequest

Does anyone have an example of how to form the body for the Lava WebRequest? I've been able to use Lava WebRequest for anything that doesn't require a body. I'm guessing it is a syntax issue, but I can't find an example of how to format the lava block. Keeping it simple, I'm trying right now just to login to the rocksolidchurchdemo site using the following lava block:

{% webrequest url: '' requestcontenttype:'application/json' responsecontenttype:'application/json' method:'POST' body: '{"Username" : "admin","Password" : "admin","Persisted" : "true"}' %}


{% endwebrequest %}

No matter how I try to form this, the constant result back is : Liquid error: The given key was not present in the dictionary. 

I've tried assigning a json variable to the body text using the FromJSON filter, but I get the same result.

Anyone point me in the right direction?  Any example of a webrequest with a body in it?

  • Photo of Gary Holeman


    Well, Jon Edmiston solved this for me over in the Rocket.Chat #develop channel.  Though I thought I had tried every possible pattern, the problem is the space after the colon on body:.  No space allowed after the tag.