addthis/fluxthis

Ability to modify XMLHttpRequest

Closed this issue · 9 comments

It would be great if FluxThis.APIActionCreator could support a way of modifying the XMLHttpRequest either via createRequest or an alternate method. This would be quite helpful in adding additional headers needed for API authentication/versioning.

You thinking an object you would return in create request? Where the key is the header key? I like that.

That sounds easy enough to do. Ill knock it out this evening.

Little clarification.

Ill add support for a 'headers' object in createRequest. If found, then we will set the headers to those key/value pairs.

Sounds great, that's what I've already implemented on my own fork:
https://github.com/mdhgriffiths/fluxthis/commit/58dca715db5b443c20e3b322822c7108b636ff09

Object.keys.... that's the method i couldn't think of for my PR (long day).

Btw, feel free to submit that PR! I'd gladly accept it instead of the one i submitted.

Thanks, will submit PR after some changes/testing.

Sounds good. I'll close mine out and wait for yours 👍

Published to npm.