Skip to content

Problem with C#. Demo code ? #23

@SimonKravis

Description

@SimonKravis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions