-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
Sending custom headers for each file #11
Comments
No, we will need to edit flow.js a bit. |
Thank you for your quick response. I'll send a PR as soon as I can work on this. 👍 |
I just had time and I realised I don't need to modify the current behaviour. I can just add the new query parameters by accessing the flowFile.
Is this the safest way for adding headers? |
Although, i suggest using query as a function:
But this is not supported for headers, a pull request would be needed. |
The way I see it, we could have it either by assigning the parameters to the flowFile, without any control per-chunk, or the query function that would allow for different parameters per-chunk. Both would be nice, as in some cases I would like to assign the same parameters for all chunks, or change parameters for each chunk. |
This is the way to assign parameters per file: var flow = new Flow({
query: function (flowFile, flowChunk) {
if (flowFile.myparams) {
return flowFile.myparams;
}
// generate some values
flowFile.myparams = {parameterName:'parameterValue'};
return flowFile.myparams;
}
}); Hope this solves your problem. |
Thank you. This works perfectly ;) 👍 This should be documented somewhere to help other users. |
Added support for custom headers. 67f70d6 |
Is it possible to send custom headers for each file?
I currently see the option to add extra headers to the global flow object, but that will impact all uploads. In my app I need to send the values pertinent to each uploading file.
Thanks,
Daniel
The text was updated successfully, but these errors were encountered: