-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set Authorization and Timeout #181
Comments
See this section of the readme for header syntax. See #175 for timeout discussion. |
I am following the same way but when I debugged the ajax request I am not able to see the authorization token. I am doing cross origin request. fetch('/users', { |
The Chrome Network panel can help debug cross-origin requests. First, disable the cache so the OPTIONS pre-flight request will occur for each cross-origin request. Then in the Network panel you can see both the OPTIONS pre-flight and the subsequent actual request. It's likely that OPTIONS is failing so your request is never made. |
Thanks for a quick reply. I have the same setting in my chrome agent and I am passing the token to the fetch request also but somehow it failing at OPTIONS request. Please find below screen shot to understand the workflow
|
The server is returning a 401 Unauthorized response to the OPTIONS request. HTML 5 Rocks has a good tutorial on how cross-origin requests work on the client and server. |
I am doing a get request and I need to pass the authorization token in the request also I need to override the timeout setting. I haven't found any way to do that in the documentation.
The text was updated successfully, but these errors were encountered: