MicrosoftTranslator / CustomTranslatorApiSamples

Custom Translator API (preview) Samples
11 stars 10 forks source link

Unexpected character encountered while parsing value: R. Path '', line 0, position 0 #15

Closed leech74 closed 7 months ago

leech74 commented 7 months ago

When I run the sample solution in Visual Studio to upload combofile, I get the following error.

image

Here is my code - uploading an Excel file as ComboFile. And debugging "result" returns "Response status code does not indicate success: 400 (Bad Request)" image

leech74 commented 7 months ago

Found out ImportComboDocument in CustomTranslatorAPIClient.cs was missing 1 line of code.

        FileForImportRequest combofile = new FileForImportRequest();
        combofile.Name = Path.GetFileName(filepath);
       combofile.LanguageCode = <dummy language code>;  // this line was missing
        combofile.OverwriteIfExists = true;