Trying to Parse a Reponse

variables

#1

So, I am trying to log the response from a local webcall as a variable but I’m not having much luck. The response is just a numerical string (i.e. 100). The url that I am using is correct because it works when i send the request with Postman. I can see the response there. But since it is just returning the number with no argument (i think that’s the right term) i can’t really use the set variable = argument, can i? any help would be appreciated.


#2

Try logging… $response $args and see which one gives you the info


#3

You mean like this: or what should I be logging?

This is what i’ve been doing but it hasn’t worked.


#4

I think I got it now. But is there an easier way to do this?


#5

I have a follow-up though…I have a page that is returning a bunch of data at once in this format:

{
“mode”: 1,
“ws2812fx_mode”: 43,
“ws2812fx_mode_name”: “Larson Scanner”,
“speed”: 244,
“brightness”: 255,
“color”: [
255,
0,
0
]
}

I can’t seem to parse out the individual aspects of each one and I have tried a who bunch of different things to get it to work.


#6

I’m on mobile, try $response.mode etc.


#7

YES!!! You are the man!!! Ugh, been struggling with that for a while now. :smiley: :+1: