Check if response appears to contain JSON content @return true if Content-Type header indicates JSON or body contains JSON markers
| 120 | /// Check if response appears to contain JSON content |
| 121 | /// @return true if Content-Type header indicates JSON or body contains JSON markers |
| 122 | bool is_json() const { |
| 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 | } |
| 131 | |
| 132 | /// Set methods (internal use) |
| 133 | void set_status(int status_code) { mStatusCode = status_code; } |