Skip to content

Commit d531935

Browse files
Update src/IBM.WatsonDeveloperCloud/Http/Request.cs
If you try to use the Text to Speech, the MemoryStream returns json as the first Accept is "application/json".
1 parent e627b90 commit d531935

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/IBM.WatsonDeveloperCloud/Http/Request.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public IRequest WithBodyContent(HttpContent body)
8181

8282
public IRequest WithHeader(string key, string value)
8383
{
84+
if (key == "Accept" && value.StartsWith("audio/", StringComparison.OrdinalIgnoreCase))
85+
{
86+
this.Message.Headers.Accept.Clear();
87+
}
8488
this.Message.Headers.TryAddWithoutValidation(key, value);
8589
return this;
8690
}

0 commit comments

Comments
 (0)