Closed liaujianjie closed 1 month ago
This is great @liaujianjie! I was thinking, what if there were a setting toggle in the node instead of both binary and text outputs? I can't really think of a case where you'd want both the binary and text output of an HTTP call, so instead we can just let the use choose which type the output of the node should be in the settings panel. That makes the node maybe simpler to use?
This is great @liaujianjie! I was thinking, what if there were a setting toggle in the node instead of both binary and text outputs? I can't really think of a case where you'd want both the binary and text output of an HTTP call, so instead we can just let the use choose which type the output of the node should be in the settings panel. That makes the node maybe simpler to use?
Definitely agree with this approach, thought I'd need some pointers on how I should do that since I'm still pretty new to Rivet.
An alternative would be to separate these into 2 PRs? So we have this PR for adding support for for the binary port on HttpCallNode
, then a second PR for adding the switch/select to choose between JSON/binary/text. This way we can also keep the scope of this PR small.
Thoughts?
That would mean maybe two releases and backwards incompatible stuff, so probably better to nail this the first time. Should be pretty easy, just checking this.data.isBinary
in both the output definitions function and the main process body. No more difficult than the stuff you've already written.
What about JSON outputs? Shouldn't the output type be one of:
@abrenneke I've went ahead to implement it such that the user can either switch between:
The option to select between the two is just below the body:
What do you think?
@all-contributors please add @liaujianjie for code
@abrenneke
I've put up a pull request to add @liaujianjie! :tada:
Resolves #386
Context
Previously, it wasn't possible to make a HTTP call (via
HttpCallNode
) and have the binary/blob data passed to anImageNode
. This PR introduces a newbinary
output port (alongside the existingbody
andjson
output ports) onHttpCallNode
to make this possible.Screengrab
How to test
ImageNode
, proving that the feature worksTest Rivet project