Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Error 405 when making a request to locally hosted webserivce from local site

I currently have a flask API and website (hosted locally using nodejs), which down the line I'm going to separate. The issue I'm having is that when I make a request from the website to my local API, it gives me a 405 Method Not Allowed error. I tried doing the request through Postman and it went through. I've also tried disabling CORS, which gave the same error.

API-side:

@app.route("/api/CreateToken", methods=['POST'])
def createToken():
    print(request.form['tokenJson'])
    return "added token successfully."

Website-side:

function test() {
    var formdata = new FormData();
    formdata.append("tokenJson", "Long string that gets processed in the API");
    var requestOptions = {
        method: 'POST',
        mode: "no-cors",
        body: formdata,
        redirect: 'follow'
    };
    console.log("Sending Token")
    fetch("192.168.0.xxx:5000/api/CreateToken", requestOptions)
        .then(response => response.text())
        .then(result => console.log(result))
        .catch(error => console.log('error', error));
}
document.addEventListener('DOMContentLoaded', (event) => {test();});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Turns out the issue was that it was going to 192.168.0.xxx:8080/192.168.0.xxx:5000/api/CreateToken because I forgot to put http:// in front of the IP of the request.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!