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

Bad Request error #17

Open
sureshVvenkatesan opened this issue May 23, 2018 · 1 comment
Open

Bad Request error #17

sureshVvenkatesan opened this issue May 23, 2018 · 1 comment

Comments

@sureshVvenkatesan
Copy link

    File file = new File("C:/New/anpr/snapshot/2018-04-20-102850.jpg");
    String secretKey = "sk_5e1dabe8c87bc1bc8dafd189b5d";
    String country = "india";
    Integer recognizeVehicle = 0;
    String state = "";
    Integer returnImage = 0;
    Integer topn = 0;
    String prewarp = null;
    InlineResponse200 response = api.recognizeFile(file, secretKey, country, recognizeVehicle, state, 
    returnImage, topn, prewarp);

I am using the above code to for recognize the license palte. But while runnig the program I have
"com.openalpr.api.invoker.ApiException: Bad Request" error. please Help me to solve this problem.

@josephfrazier
Copy link

I'm having a similar issue with recognizeFile in the JavaScript library. If I pass a File or a Buffer as the first argument, I get the following error response:

{"error_code": 400, "error": "Missing file named \"image\" in request POST"}

The request body (shown below) appears to have the "image" field, but it's empty:

------WebKitFormBoundaryr25bSQzqnmKq83cG
Content-Disposition: form-data; name="image"; filename="ETCG38.jpg"
Content-Type: image/jpeg


------WebKitFormBoundaryr25bSQzqnmKq83cG--

My best guess is that the problem (for JavaScript) might be in superagent, since that's what's used to build the request:

var request = superagent(httpMethod, url);

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

2 participants