Use constants for HTTP headers (#10313)
* Use constants for HTTP headers * Fix ordering * Move 'no-cache' to platform
This commit is contained in:
1 parent
e64803e701
commit
de9d19d6f4
36 files changed
+408
-444
No files matched your search
@@ -6,14 +6,14 @@ https://home-assistant.io/components/notify.facebook/
|
||||
"""
|
||||
import logging
|
||||
|
||||
from aiohttp.hdrs import CONTENT_TYPE
|
||||
import requests
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET, ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
ATTR_DATA, ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
from homeassistant.const import CONTENT_TYPE_JSON
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -70,7 +70,7 @@ class FacebookNotificationService(BaseNotificationService):
|
||||
import json
|
||||
resp = requests.post(BASE_URL, data=json.dumps(body),
|
||||
params=payload,
|
||||
headers={'Content-Type': CONTENT_TYPE_JSON},
|
||||
headers={CONTENT_TYPE: CONTENT_TYPE_JSON},
|
||||
timeout=10)
|
||||
if resp.status_code != 200:
|
||||
obj = resp.json()
|
||||
|
||||
Reference in new issue
Block a user