-
Notifications
You must be signed in to change notification settings - Fork 88
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
allow receive single HTTP measures using attribute values in plain, raw and json content-types #667
Conversation
Based in bodyparser custom middleware described in https://stackoverflow.com/questions/54226441/body-parser-use-bodyparser-middleware-from-another-middleware |
Default attribute type used by MQTT when a single measrue is receive from |
Should a twin PR be done for IOTA-UL? |
This issue does not applies to iota-ul |
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
CHANGES_NEXT_RELEASE
Outdated
- Add: allow receive single HTTP attribute measures posted to `/iot/json/attrs/<attributeName>` with different content-types `application/json`, `text/plain` and `application/octet-stream` | ||
- Upgrade body-parser dep from 1.18.3 to 1.20.0 | ||
- Upgrade express dep from ~4.16.4 to 4.18.1 | ||
- Fix: do not use json parse strict for incoming http measures, commands and configuration |
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.
Issue #661 should be cited (not sure if in the "Add:" line, in the "Fix:" line or in both)
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.
Done in 6d42384
Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.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
issue #661
/iot/json/attrs/:attrValue
allowing these content-types:application/json
,text/plain
,application/octet-stream
This PR enables send single measures like:
curl -i -X POST 'http://localhost:7897/iot/json/attrs/myattr1?i=disp4&k=6idn7z9cba3o57tgoascazdwd' -d '33' -H 'content-type: application/json'
curl -i -X POST 'http://localhost:7897/iot/json/attrs/myattr1?i=disp4&k=6idn7z9cba3o57tgoascazdwd' -d 'asdfasdfasd' -H 'content-type: text/plain'
curl -i -X POST 'http://localhost:7897/iot/json/attrs/myattr1?i=disp4&k=6idn7z9cba3o57tgoascazdwd' -d '01010011' -H 'content-type: application/octet-stream'