0

I started the rasa server by typing this command in cmd:

  rasa run --enable-api -m models/(my_model).tar.gz --cors "*" --debug

I put this command in another cmd:

  curl -X POST localhost:5005/model/parse -d '{"text":"hello"}'

After that I got this error:

  {"version":"1.2.2","status":"failure","message":"An unexpected error occurred. Error: Failed when parsing body as json","reason":"ParsingError","details":{},"help":null,"code":500}

Any help? How can I integrate Rasa with Node.js?

  • what does the server log from the `rasa run` command show? you might also need to set the json header in your curl request: `-H "Content-Type: application/json"` – tmbo Aug 21 '19 at 08:30

3 Answers3

0

Please try

 curl -H "Content-Type: application/json"  -X POST -d '{"sender":"y1mLd","message":"hi"}' http://localhost:5005/webhooks/rest/webhook

Output would be

[{"recipient_id":"y1mLd","text":"Welcome, Please let me know how I could be a help today!"}]

Hope this helps!

neel
  • 572
  • 4
  • 17
0

Simple curl without method type worked for me:

curl localhost:5005/model/parse -d '{"text":"hello"}'
sam
  • 2,263
  • 22
  • 34
0

I also faced this error on Windows 10 . Following commands worked for me finally.

curl localhost:5005/model/parse -d "{\"text\":\"hello\"}"

and

curl -H "Content-Type: application/json" -X POST localhost:5005/model/parse -d "{\"text\":\"hello\"}"