Skip to content

Commit

Permalink
added encoding header to duckling remote http request
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Nov 8, 2017
1 parent c75e635 commit 2ea8189
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rasa_nlu/extractors/duckling_http_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def _duckling_parse(self, text):
"""Sends the request to the duckling server and parses the result."""

payload = {"text": text, "lang": self.language}
response = requests.post(self.duckling_url + "/parse", data=payload)
headers = {"Content-Type": "application/x-www-form-urlencoded; "
"charset=UTF-8"}
response = requests.post(self.duckling_url + "/parse",
data=payload,
headers=headers)
if response.status_code == 200:
return simplejson.loads(response.text)
else:
Expand Down

0 comments on commit 2ea8189

Please sign in to comment.