How to include header in ajax request?

前端 未结 3 1581
情话喂你
情话喂你 2021-01-24 18:37

I need to include a header with a refresh token in an ajax call to the YouTube api. I am trying to send a delete request, to delete a movie I have on my account. This is my ajax

3条回答
  •  独厮守ぢ
    2021-01-24 19:02

    You can use beforeSend method and request.setRequestHeader. Take a look at the official documentation here.

    P.S. should I post it as a comment?

提交回复
热议问题