ajax addition request header (add Authorization field)

When we send AJAX requests may require custom request headers, provides a convenient beforeSend property in the jQuery $ .ajax () method we do this.

beforeSend: function(request) {
    request.setRequestHeader("Authorization", sessionStorage.getItem("Authorization"));
}

Very simple to use.

 

" Our generation of young men, many of them no escape route. Felt like a failure and see the end of time, and that the outside world does not default [haven], you will not find a good home [so], that have returned mom and Dad's house, the next day had finished, or perk start again. I see at least the young, there is very little around the house as a retreat, in the valley, even family members will give greater pressure many young people standing in the middle of the road, standing on the way crying, lonely and helpless. no lights behind him, in front of white mist and fog.  "

Guess you like

Origin www.cnblogs.com/yanggb/p/12039665.html