【问题标题】:Error: "Request failed with status code 500" con laravel en axios.put()错误:“请求失败,状态码 500” con laravel en axios.put()
【发布时间】:2019-07-02 17:09:16
【问题描述】:

我正在学习在这种情况下使用 laravel 版本 5.6,通过使用 axios 实现代码来更新我网页上的表格,我收到以下消息 enter image description here 我遇到问题的代码是下一个

actualizarCategoria(){
               if (this.validarCategoria()){
                    return;
                }
                
                let me = this;

                axios.put('/categoria/actualizar',{
                    'nombre': this.nombre,
                    'descripcion': this.descripcion,
                    'id': this.categoria_id
                }).then(function (response) {
                    me.cerrarModal();
                    me.listarCategoria();
                }).catch(function (error) {
                    console.log(error);
                }); 
            }

【问题讨论】:

  • 可以展示一下你的axios配置文件吗?

标签: javascript php laravel axios laravel-5.6


【解决方案1】:

我会说错误 500 = 来自您的服务器的错误。因此,您的请求可能格式不正确,或者是您的 API 中的错误(laravel 方面)。检查您的 PHP 日志,您应该会看到一个错误并查看 chrome 中的网络选项卡以查看来自服务器的响应

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-05-29
    • 1970-01-01
    • 2019-11-27
    • 2021-10-01
    • 2018-11-29
    • 1970-01-01
    • 2020-10-21
    • 2020-09-18
    相关资源
    最近更新 更多