Dust Community Icon

Understanding Output Properties of cURL Block in Dust Apps

·
·

Does anyone know what the output properties are from the cURL block in a Dust app? I tried asking @help but didn't get a useful response. For example, let's say I have a cURL block that's called LOCATE. In a subsequent code block, I'd like to access properties from env.state.LOCATE but I don't know what properties are available.

  • Avatar of David Ebbo
    David Ebbo
    ·
    ·

    Hi Marty. The available properties are status , headers and body. e.g. env.state.LOCATE.headers["transfer-encoding"], env.state.LOCATE.body.someProp .

  • Avatar of Marty Chang
    Marty Chang
    ·
    ·

    Awesome, thank you David Ebbo!

  • Avatar of Alban
    Alban
    ·
    ·

    Hi Marty, you can just to a console.log(env.state.LOCALE) in a code block to see what's available 🙂

  • Avatar of David Ebbo
    David Ebbo
    ·
    ·

    Alban nice, I didn't know the logs were made available. I was achieving the same with return env.state.LOCALE to see everything.