You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -33,14 +33,17 @@ To register a response processor you need to import the Processing class and the
33
33
client= Client(url, token)
34
34
print(client.get_entities())
35
35
36
+
36
37
In this example.
37
38
The first processor (a function wrapped with the processor decorator) is going to be called when we receive a response that has that as its :code:`Content-Type` header.
38
-
Because :code:`homeassistant_api` provides processors for :code:`text/plain`and :code:`application/json` by default,
39
+
Because :code:`homeassistant_api` provides processors for :code:`application/octet-stream`and :code:`application/json` by default,
39
40
we need to tell :code:`homeassistant_api` to override the default processor with :code:`override=True`.
40
41
41
42
The second processor is an async processor that only gets called when AsyncClient receives a response that has :code:`text/csv`as its :code:`Content-Type` header.
42
43
If you wanted to override :code:`homeassistant_api`'s default json processing using the :code:`json` module with a different way to process json data.
43
44
Such as using instead, the :code:`ujson` module (which is faster but more limiting).
44
45
45
46
The third processor function implements the default processor function for the :code:`application/json` mimetype after printing a string.
46
-
If you wanted to run some intermediate processing
47
+
If you wanted to run some intermediate processing.
48
+
49
+
Most likely the only processors you will ever use are :code:`application/json`and :code:`application/octet-stream`
print("If this happened, please report it at https://github.com/GrandMoff100/HomeAssistantAPI/issues with the request status code and the request content")
0 commit comments