普通网友 2015-10-07 14:59
浏览 32

IE9 AJAX对Rails的调用失败

I am trying to sent a PATCH request from the client to the rails backend.

This works fine in FF/Chrome and IE10+.

The problem seems to be XDomainRequest. I am using jQuery and tried to just send a POST request and change it to PATCH with'X-Http-Method-Override': 'PATCH'.

Unfortunately it seems that IE9 does not allow to set custom headers, since it does not show up in the HTTP Request.

On the backend I get errors, because the route for a POST request is not found.

I also tried appending _method=patch to the URL params and _method: "patch" to the request body, but it still doesnt work. Also I can not change the Content-Type to anything else than Plain/Text in IE9.

Is there any way to sent a POST request from IE9 and get it recognized as a PATCH Request by my Rails Backend?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 shape_predictor_68_face_landmarks.dat
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制