Why my $.ajax showing “preflight is invalid redirect error”?

后端 未结 8 749
花落未央
花落未央 2020-11-28 11:04

I tried the following code in Postman and it was working. Is there something wrong with the code?

$.ajax({
   url: \'http://api.example.com/users/get\',
   t         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 11:34

    My problem was caused by the exact opposite of @ehacinom. My Laravel generated API didn't like the trailing '/' on POST requests. Worked fine on localhost but didn't work when uploaded to server.

提交回复
热议问题