Access Control Request Headers, is added to header in AJAX request with jQuery

前端 未结 6 1404
不知归路
不知归路 2020-11-22 10:29

I would like to add a custom header to an AJAX POST request from jQuery.

I have tried this:

$.ajax({
    type: \'POST\',
    url: url,
    headers:          


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 10:51

    Try to use the rack-cors gem. And add the header field in your Ajax call.

提交回复
热议问题