3

This is my Command and i'm using Mac os,

curl -X POST \
-u "{username}":"{password}" —-header "Content-Type:application/json" --data "{\"input\": {\"text\": \"Turn on the lights\"}, \"context\": {\"conversation_id\": \"1b7b67c0-90ed-45dc-8508-9488bc483d5b\", \"system\": {"dialog_stack":[{"dialog_node":"root"}], \"dialog_turn_counter\": 1, \"dialog_request_counter\": 1}}}" "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/25dfa8a0-0263-471b-8980-317e68c30488/message?version=2016-09-20"

When i apply this the error log is,

curl: (6) Could not resolve host: —-header
curl: (6) Could not resolve host: Content-Type
{"error":"Unsupported Media Type"}

Please help me to solve this issue.

Thanks in advance...

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
User 1278
  • 177
  • 2
  • 2
  • 8

2 Answers2

6

In your —-header option the first character isn’t a normal hyphen (U+002d). Instead it’s an em dash (U+2014). Change it to a normal hyphen and things should work as expected.

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
1

You can solve theese problems by using this code

curl -X POST -u "CONVERSATION_USERNAME":"CONVERSATION_PASSWORD" -H "Content-Type:application/json" -d "{\"input\": {\"text\":\" \"}}" "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/CONVERSATION_ID/message?version=2016-07-11"
user94
  • 409
  • 1
  • 6
  • 20