-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Set custom request headers #47
Comments
Added ability to pass custom headers in request. Fixes issue #47.
Thank you very much for this. I just merged your PR, but there are a couple of changes I'm about to push. When looping through objects, it's good practice to use for ( var headerName in opts.customHeaders ) {
if ( opts.customHeaders.hasOwnProperty( headerName ) ) {
xhr.setRequestHeader( headerName, opts.customHeaders[headerName] );
}
} |
LPology, thank you for pointing out the |
And thanks for your input. If you find anything else, please feel free to open an issue. I definitely appreciate it. |
👍 Thanks guys! |
It'd be great to have a headers option you can pass in, like you can with [jQuery.ajax]. I need to pass along an auth token in Authorization header.
The text was updated successfully, but these errors were encountered: