deploy-ml-model
deploy-ml-model copied to clipboard
Getting error while sending test data using curl in local server
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]'
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.
_
request.json() is returning none @Abhijit5676 thats the cause of this error
@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