-
Notifications
You must be signed in to change notification settings - Fork 202
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
response headers #9
Comments
Currently, you cannot do it. What is your use case? |
Need to handle data I'm getting back through 'Authorization' headers. |
Are you talking about the |
Well, technically you're doing that already since I do however, see where you're coming from with this. Perhaps adding a new config key which determines which headers are being passed on as part of the payload could be an option? export function fetchUser(userId, schema = userSchema) {
return {
[CALL_API]: {
types: ['FETCH_USER.REQUEST', 'FETCH_USER.SUCCESS', 'FETCH_USER.FAILURE'],
endpoint: `/users/${userId}`,
method: 'GET',
headers: {
request: {
credentials: 'same-origin'
},
response: ['Authorization', 'X-SomeToken']
}
},
payload: { somePayload }
};
} Thoughts? |
That sounds good, but I'd need to rearrange a few things. I'll let you know soonish. |
I also need this feature. real-world example in redux also get 'link' data from header. |
Solved by |
For others looking at how to handle custom headers in the response, here's how I did mine.
Here's a simplified version of my success wrapper, which checks a response header to see if the server wants the client to force a reload (after a deploy) and passes that client-version off to a redux action:
|
I'm looking for a way to get ahold of the response headers from a
POST
request. How would I go about this?The text was updated successfully, but these errors were encountered: