machinebox / issues

Machine Box issues, bugs and feature requests
2 stars 0 forks source link

Facebox console has incorrect cURL command #13

Closed montanaflynn closed 6 years ago

montanaflynn commented 6 years ago

Under cURL section it shows a mixture of JSON and query parameters which results in a 400 response with a message about missing the required name field. The fix is to send the name, ID and url in the request's JSON body.

$ curl 'http://127.0.0.1/facebox/teach?name=John+Lennon&id=john.jpg' -H 'Content-Type: application/json' -d '{"url":"https://machinebox.io/samples/faces/john.jpg"}' 
missing parameter: name
$ curl 'http://127.0.0.1/facebox/teach' -H 'Content-Type: application/json' -d '{ "url": "https://machinebox.io/samples/faces/john.jpg", "id": "john.jpg", "name": "John Lennon" }'
{
    "success": true
}

Additionally all the examples under "Learn about the different ways to submit a file" section only show how to send the file, I think it would be prudent to include the required name and ID as well.

matryer commented 6 years ago

Fixed. Will go into next release.