Skip to content

Commit 8f863ff

Browse files
Merge pull request #312 from watson-developer-cloud/fix-add-custom-word-method
fix add_custom_word() to use PUT
2 parents 3699298 + 67e27cd commit 8f863ff

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

test/test_speech_to_text_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_custom_words():
160160
words_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/{0}/words'
161161
word_url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/customizations/{0}/words/{1}'
162162

163-
responses.add(responses.POST, word_url.format('custid', 'IEEE'),
163+
responses.add(responses.PUT, word_url.format('custid', 'IEEE'),
164164
body='{"get response": "yep"}',
165165
status=200,
166166
content_type='application/json')

watson_developer_cloud/speech_to_text_v1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def add_custom_word(self, customization_id, custom_word):
192192

193193
custom_word_fragment = {'sounds_like': custom_word.sounds_like,
194194
'display_as': custom_word.display_as}
195-
return self.request(method='POST',
195+
return self.request(method='PUT',
196196
url=url.format(customization_id,
197197
custom_word.word),
198198
data=json.dumps(custom_word_fragment),

0 commit comments

Comments
 (0)