Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

103
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda