You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
First of all, the example provided in the File Upload documentation is incorrect, such as adding the Bearer token twice, and the File parameter is set as text. The test via the web page also always results in an error.
Using Postman, the web interface, and Python with HTTP Client, I am able to successfully upload the file and later perform the Get request without any issues. However, when it comes to C# .Net, it doesn't work. The example and simple Upload implementation just return an error.
Could you provide a simple File Upload example?
Job ID
I don't have a Job ID because it was not generated in any of the tests via C#.
This is the ID using Python HTTP Client db95fba2-5ee0-4fff-95b6-708256ced7c9, and this is the ID using the library in Python 5b5f13bc-31d3-4420-af65-130652bdcacf.
Client:
Please remove untested options:
API
Additional context
The error:
BadRequest - {"detail":"There was an error parsing the body"}
Below is the snippet of my code that is throwing an error:
publicstaticasyncTaskUploadFileAsync(byte[]byteArrayFile,FileStreamfileStream,stringfileName){stringurl=_baseUrl+_baseUrlUpload;using(HttpClientclient=newHttpClient()){client.DefaultRequestHeaders.Authorization=newAuthenticationHeaderValue("Bearer",_apiKey);using(varcontent=newMultipartFormDataContent()){varfileContent=newByteArrayContent(byteArrayFile);//var fileContent = new StreamContent(fileStream); content.Add(fileContent,"file",fileName);content.Add(newStringContent("true"),"fast_mode");content.Add(newStringContent("en"),"language");try{HttpResponseMessageresponse=awaitclient.PostAsync(url,content);stringresponseContent=awaitresponse.Content.ReadAsStringAsync();if(response.IsSuccessStatusCode){Console.WriteLine(responseContent);}else{Console.WriteLine($"Fail to send file: {response.StatusCode} - {responseContent}");}}catch(Exceptionex){Console.WriteLine($"Error: {ex.Message}");}}}}
Or when I make any changes that return an ID, I get the following error:
Describe the bug
First of all, the example provided in the File Upload documentation is incorrect, such as adding the Bearer token twice, and the File parameter is set as text. The test via the web page also always results in an error.
Using Postman, the web interface, and Python with HTTP Client, I am able to successfully upload the file and later perform the Get request without any issues. However, when it comes to C# .Net, it doesn't work. The example and simple Upload implementation just return an error.
Could you provide a simple File Upload example?
Files
02593-3_HUMBERG AGRIBRA_11-2024_1_Individual.pdf
Job ID
I don't have a Job ID because it was not generated in any of the tests via C#.
This is the ID using Python HTTP Client db95fba2-5ee0-4fff-95b6-708256ced7c9, and this is the ID using the library in Python 5b5f13bc-31d3-4420-af65-130652bdcacf.
Client:
Please remove untested options:
Additional context
The error:
Below is the snippet of my code that is throwing an error:
Or when I make any changes that return an ID, I get the following error:
The text was updated successfully, but these errors were encountered: