Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with C#. Demo code ? #23

Open
SimonKravis opened this issue Sep 30, 2020 · 0 comments
Open

Problem with C#. Demo code ? #23

SimonKravis opened this issue Sep 30, 2020 · 0 comments

Comments

@SimonKravis
Copy link

SimonKravis commented Sep 30, 2020

I am having problems with Postman code for c#. The suggested code for a detect operation is
var client = new RestClient("https://api.kairos.com/detect"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("app_id", "3458eaed"); request.AddHeader("app_key", "2b9f9b765126465d4dcd263bbd5f8dc6"); request.AddFile("image", "/C:/Users/Simon/Pictures/Faces/Test (7).jpg"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);

This fails with an Illegal path message from C# in request.AddFile. Changing the line to
request.AddFile("image", @"C:\Users\Simon\Pictures\Faces\Test (7).jpg");
results in the request running OK but returning response content with the error message “image one or more required parameters are missing”.

The error message below is obtained in Postman by changing the Key value to anything other than "image" or the Value value to a non-existent local file
image one or more required parameters are missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant