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

后端 未结 8 790
花落未央
花落未央 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:38

    I received the same error when I tried to call https web service as http webservice.

    e.g when I call url 'http://api.example.com/users/get'
    which should be 'https://api.example.com/users/get'
    

    This error is produced because of redirection status 302 when you try to call http instead of https.

提交回复
热议问题