Visualizzazione risultati 1 fino 4 di 4

Discussione: 405 Method Not Allowed

  1. #1
    Guest

    Predefinito 405 Method Not Allowed

    Se tento di fare una richiesta DELETE Altervista mi risponde in questo modo:

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>405 Method Not Allowed</title>
    </head><body>
    <h1>Method Not Allowed</h1>
    <p>The requested method DELETE is not allowed for the URL /server/product/.</p>
    </body></html>


    Sono forse consentiti solo POST e PUT?

  2. #2
    L'avatar di alemoppo
    alemoppo non è connesso Staff AV
    Data registrazione
    24-08-2008
    Residenza
    PU / BO
    Messaggi
    22,067

    Predefinito

    Come tenti di fare la richiesta? Io ho provato e funziona correttamente. Più semplicemente puoi provarlo con un normale form html:
    Codice HTML:
    <form action="" method="DELETE">
    ...
    Ciao!
    Ultima modifica di alemoppo : 26-01-2019 alle ore 14.09.50

  3. #3
    Guest

    Predefinito

    Questa e' la richiesta che faccio:


    axios({
    method: 'DELETE',
    url: conf.domain + '/product/' + id,
    })
    .then(resp => console.log(resp))
    .catch(error => console.log(error))


    Ho tentato anche con curl:

    curl -X DELETE "http://ilamone.altervista.org/"
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>405 Method Not Allowed</title>
    </head><body>
    <h1>Method Not Allowed</h1>
    <p>The requested method DELETE is not allowed for the URL /index.html.</p>
    </body></html>


    o anche ...

    curl -X DELETE http://ilamone.altervista.org/server...e272df159cbcc7
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>405 Method Not Allowed</title>
    </head><body>
    <h1>Method Not Allowed</h1>
    <p>The requested method DELETE is not allowed for the URL /server/web/product/aa180429ee9bc0fd68e272df159cbcc7.</p>
    </body></html>
    Ultima modifica di ilamone : 27-01-2019 alle ore 11.08.00

  4. #4
    L'avatar di alemoppo
    alemoppo non è connesso Staff AV
    Data registrazione
    24-08-2008
    Residenza
    PU / BO
    Messaggi
    22,067

    Predefinito

    Puoi provare verso una pagina PHP (esistente)?
    Ad esempio, ho provato così:
    Codice:
    $ curl -X "DELETE" http://ilamone.altervista.org/server/web/index.php
    [{"product":{"id":"459fd018cfd6f8d6e19cbe11283d6f8f","name":"Biscotti integrali"}},{"product":{"id":"582e487d1f578c906447f5f95d39c8f5","name":"Carta igienica"}},{"product":{"id":"6729abc94ad2b42a5f235f1a1ea050f3","name":"Latte in polvere 2"}}]
    Ciao!

Tags for this Thread

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •