Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

108
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda