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
[blockly] Provide HTTP request block #2411
Conversation
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
Job #1725: Bundle Size — 11.03MiB (+0.09%).Warning Bundle contains 19 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
View job #1725 report View stefan-hoehn:http_blocks branch activity View project dashboard |
Can GET also set headers? Another thing that would be handy is a query builder, ie given a dictionary of key value, append |
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general LGTM, just a few comments, mostly wrt to code style.
bundles/org.openhab.ui/web/src/components/config/controls/blockly-editor.vue
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Show resolved
Hide resolved
Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
bundles/org.openhab.ui/web/src/assets/definitions/blockly/blocks-http.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I am experimenting with this new functionality. I would be interested in this as well. And another thing that could be useful in this context: a urlEncode function. Parameters in GET calls will have to be URL encoded. If extending the block with a query builder, the logic could include URL encoding the parameters. |
The groundwork for this could be done inside openhab-js, where we could also check whether there already are npm modules to encode urls so we don’t have to write the logic ourselves ;-) |
This is finally the missing HTTP Request block for Blockly.
In this case I tried to make the block as concise as possible. Therefore it contains to block mutation switches that allow hide/unhide timeout and headers if they are needed or not.