deploy-ml-model icon indicating copy to clipboard operation
deploy-ml-model copied to clipboard

Getting error while sending test data using curl in local server

Open Abhijit5676 opened this issue 5 years ago • 2 comments

Getting error while sending test data using curl in local server app.py: return self.view_functionsrule.endpoint File "app.py", line 28, in get_prediction data = np.array(data)[np.newaxis, :] # converts shape from (4,) to (1, 4) IndexError: too many indices for array 127.0.0.1 - - [31/Mar/2020 16:06:23] "[35m[1mPOST /predict HTTP/1.1[0m" 500 -_

Curl post: _curl -X POST 127.0.0.1:5000/predict -H 'Content-Type:application/json' -d '[5.9,3.0,5.1,1.8]'

500 Internal Server Error

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

_

Abhijit5676 avatar Mar 31 '20 10:03 Abhijit5676

request.json() is returning none @Abhijit5676 thats the cause of this error

ajithvcoder avatar Sep 04 '20 06:09 ajithvcoder

@Abhijit5676 try this it works curl -i -X POST -H "Content-Type:application/json" -d "[5.9,3.0,5.1,1.8]" http://localhost:5000/predict

ajithvcoder avatar Sep 04 '20 07:09 ajithvcoder