I am working on a Unit Conversion API, and I am having a lot of issues with fetch(). My backend API is working, for example, when I call
curl "http://localhost:8000/unitconv/convert?to=lb&from=kg&value=10" I get the correct response:
{"units": "lb", "value": 22.04623}. Yet when I do the exact same thing with fetch(), this is what I get:
I have tried both localhost and 127.0.0.1 and I still cannot get past this "undefined". What's wrong here?
Add a comment
|