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

102
Views
post method in ajax request Method Not Allowed in js

I tried to post method in ajax request Method Not Allowed in js and give me Status Code 405 please help me

// js code

        const xml = new XMLHttpRequest();
        
        xml.onload = function(){
           console.log(this.responseText);
        }
        
        
        xml.open("POST","receive.php",true);
        
        xml.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
        
        xml.send("name=kareem&lastvist=Today");

// php code

        <?php
        foreach ($_POST as $post_var) {
            echo strtoupper($post_var)
        }
        
        ?>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The 405 Method Not Allowed error occurs when the web server is configured in a way that does not allow you to perform a specific action for a particular URL. It’s an HTTP response status code that indicates that the request method is known by the server but is not supported by the target resource.

If you calling XMLHttpRequest().open() this method for an already active request (one for which open() has already been called) is the equivalent of calling abort().

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!