8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Currently, rest_command does not allow you to config the request content type, which runs afoul of more strict api end points.
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2430
configuration.yaml
# Example configuration.yaml entry rest_command: example_request: url: 'http://example.com/' content_type: 'text/plain'
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
REQUIREMENTS
requirements_all.txt
script/gen_requirements_all.py
.coveragerc
If the code does not interact with devices:
Sorry, something went wrong.
exposed content_type in rest_command, which allows for manually speci…
9925888
…fying the content_type for more-strict api endpoints
@cmsimike, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @robbiet480 and @fabaff to be potential reviewers.
Hi @cmsimike,
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
line too long (86 > 79 characters)
fixed up column length
7a93a1a
Length was 86 chars, and it needed to be 79
double import of HTTP_HEADER_CONTENT_TYPE
ee5aff5
Removed the accidental double-import of HTTP_HEADER_CONTENT_TYPE
It need also unittests...
I think we should not set a default content type and force overwrite aiohttp internals. So if no type is get we should set headers None
Move that to component
To be clear, you mean to move this into rest_command.py?
I hope to address these comments tomorrow as I am about to step out for the night. Thanks!!
moved rest_command-specific config value into component
12c2cdc
if no content_type, default to None
dd99ce2
unit test
01d9e26
no newline at end of file
newline
0509dc5
unused CONTENT_TYPE_TEXT_PLAIN
5d522bd
@pvizeli I believe your concerns have been addressed. I am not sure if there is a more official way for me to mark this as done.
Done!
Please use: https://github.com/aio-libs/aiohttp/blob/master/aiohttp/hdrs.py#L45 so we are sure that we right expose it to api
removed the http-agnostic abstraction hass provided in favor of aioht…
411b263
…tps hdrs constant
Done 2: code boogaloo
⚡
226066e
houndci-bot houndci-bot left review comments
pvizeli pvizeli approved these changes
Successfully merging this pull request may close these issues.