A member of my team developed this API where you send some numeric values and it gives you back a probability. He deployed it in Heroku
and sent me the task of connecting it with our backend, you can make the call from cmd like this:
curl -d "{\"Values\":[[value1,value 2,value 3,value 4,value 5]]}" -H "Content-Type: application/json" -X POST https://apibc1.herokuapp.com/predict
And it will work just like intended, but to be honest I don't know how to make this call in my server file, I'm trying to use the request package in Node but I keep getting the invalid URI error on my logs. An example of the API working from cmd:
And this is what happens when I make the same call in my server.js file:
CodePudding user response:
If you have a working curl you can import it into postman and generate a working code sample for a lot of languages.
- Import the curl request
- Then click the code button on the right
- and select a language/framework option from the dropdown