Share feedback, ideas and get community help

Updated 4 months ago

I need the entire response from an http request

My problem is simple, but couldn't find anywhere talking about this, the http request integration doesn't seem to let you save the entire response (no i can't save each piece of the response in a var because the response has lots of possibilities, nothing i can easily map) in a variable, so i tried using scripts but nothing i try works.

the error i'm getting: SyntaxError: Unexpected token 'o', "[object Response]" is not valid JSON

here is the last iteration my my script following what i found on the documentation and basic js knowledge:
const response = await fetch(`${{databaseRequest}}', {
method: 'GET',
headers: {
'apikey': 'the api key value'
}
})
const data = JSON.parse(response)

setVariable({{questionResponse}}, data)

sorry if this is some rookie mistake, i'm kinda knew to everything here, before this i only did some smal backend and math problem solving with python. I really don't understand what the syntax error means, i kinda see where it's going but can't completely understand it.

the databaseRequest is a valid url, i've tested it many times
B
1 comment
You could debug the response like this:

const response = await fetch('https://jsonplaceholder.typicode.com/todos/1')
setVariable("My variable name", response)
Add a reply
Sign up and join the conversation on Discord