Use content type json constant (#40312)
This commit is contained in:
1 parent
9c1eb78a0f
commit
6a7caad8dc
28 files changed
+170
-153
No files matched your search
@@ -6,6 +6,7 @@ import pytest
|
||||
|
||||
from homeassistant.components import alexa
|
||||
from homeassistant.components.alexa import intent
|
||||
from homeassistant.const import CONTENT_TYPE_JSON
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@@ -111,7 +112,7 @@ def _intent_req(client, data=None):
|
||||
return client.post(
|
||||
intent.INTENTS_API_ENDPOINT,
|
||||
data=json.dumps(data or {}),
|
||||
headers={"content-type": "application/json"},
|
||||
headers={"content-type": CONTENT_TYPE_JSON},
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import json
|
||||
|
||||
from homeassistant.components.alexa import DOMAIN, smart_home_http
|
||||
from homeassistant.const import HTTP_NOT_FOUND
|
||||
from homeassistant.const import CONTENT_TYPE_JSON, HTTP_NOT_FOUND
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import get_new_request
|
||||
@@ -17,7 +17,7 @@ async def do_http_discovery(config, hass, hass_client):
|
||||
response = await http_client.post(
|
||||
smart_home_http.SMART_HOME_HTTP_ENDPOINT,
|
||||
data=json.dumps(request),
|
||||
headers={"content-type": "application/json"},
|
||||
headers={"content-type": CONTENT_TYPE_JSON},
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
Reference in new issue
Block a user