When using Postman to run your project, you may get the following error.
Cause of error
When you get this error, you are most likely suffering from one of the following causes:
- The endpoint doesn’t exist; this could be a spelling error;
- The Server port is different.
- Your website’s URL is incorrect
- The endpoint could be working perfectly in Development. However, somewhere the staging or production it caused an error.
How to fix it?
This is a fairly common error, here are some of our solutions. Please consult and choose the appropriate method for your program.
Option 1: Edit URL path
Try removing or adding “/” at the start of the URL, especially when you don’t provide your hostname. i.e.
fetch('getusername') is different from
fetch('/getusername'). This is fine in the development phase, however not when already implemented in the field, as it indicates a an alternative route.
Option 2: Do the same thing in a web browser
Option 3: Accessing URL through the browser.
If you get the error caused by the wrong URL, try accessing it through the browser.
Please leave a comment if you want to learn more about the topic or if you have any questions or ideas to share. Thank you for taking the time to read this!