Replies: 2 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Guys, I am st2 newer,please help me
Local webhook trigger : curl -X POST --data '{"name":"icon", "age":18}'
Action yaml parameters : content string
Action py :
from st2common.runners.base_action import Action
class WebexTeamsChatAction(Action):
def run(self, content):
content = json.loads(content)
print(content["name"])
return content["age"]
Raise error : json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
id: 642fc3b0f7419d50a9507cf8
action.ref: default.bot-index
context.user: stanley
parameters:
content: '{' 'name' ': ' 'icon' ', ' 'age' ': '18 }'
status: failed (1s elapsed)
start_timestamp: Fri, 07 Apr 2023 07:18:08 UTC
end_timestamp: Fri, 07 Apr 2023 07:18:09 UTC
👎 '{"name":"icon", "age":18}' --------> '{' 'name' ': ' 'icon' ', ' 'age' ': '18 }'
how to handle this string: '{' 'name' ': ' 'icon' ', ' 'age' ': '18 }'
python do not surpport ' '
Beta Was this translation helpful? Give feedback.
All reactions