FastLED 3.9.15
Loading...
Searching...
No Matches

◆ is_json()

bool fl::response::is_json ( ) const
inline

Check if response appears to contain JSON content.

Returns
true if Content-Type header indicates JSON or body contains JSON markers

Definition at line 127 of file fetch.h.

127 {
128 auto content_type = get_content_type();
129 if (content_type.has_value()) {
130 fl::string ct = *content_type;
131 // Check for various JSON content types (case-insensitive)
132 return ct.find("json") != fl::string::npos;
133 }
134 return false;
135 }
fl::size find(const char &value) const
Definition str.h:408
fl::optional< fl::string > get_content_type() const
Get content type convenience method.
Definition fetch.h:112
static const fl::size npos
Definition str.h:597

References fl::StrN< SIZE >::find(), get_content_type(), and fl::string::npos.

Referenced by json(), test_json_await(), and test_json_response().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: