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

◆ is_json()

bool fl::net::http::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 122 of file fetch.h.

122 {
123 auto content_type = get_content_type();
124 if (content_type.has_value()) {
125 fl::string ct = *content_type;
126 // Check for various JSON content types (case-insensitive)
127 return ct.find("json") != fl::string::npos;
128 }
129 return false;
130 }
fl::size find(const char &value) const FL_NOEXCEPT
fl::optional< fl::string > get_content_type() const
Get content type convenience method.
Definition fetch.h:107
static constexpr fl::size npos
Definition string.h:195

References fl::basic_string::find(), get_content_type(), and fl::string::npos.

Referenced by json(), test_get_endpoint(), and test_json_endpoint().

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