| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,6 +47,14 @@ void HTTPResponse::setStatusText(std::string statusText) { | |||
| 47 | 47 | _statusText = statusText; | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | + uint16_t HTTPResponse::getStatusCode() { | ||
| 51 | + return _statusCode; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + std::string HTTPResponse::getStatusText() { | ||
| 55 | + return _statusText; | ||
| 56 | + } | ||
| 57 | + | ||
| 50 | 58 | void HTTPResponse::setHeader(std::string name, std::string value) { | |
| 51 | 59 | _headers.set(new HTTPHeader(name, value)); | |
| 52 | 60 | } | |
@@ -102,7 +110,7 @@ void HTTPResponse::printHeader() { | |||
| 102 | 110 | ||
| 103 | 111 | // Status line, like: "HTTP/1.1 200 OK\r\n" | |
| 104 | 112 | //intToString(_statusCode) | |
| 105 | - std::string statusLine = "HTTP/1.1 200 " + _statusText + "\r\n"; | ||
| 113 | + std::string statusLine = "HTTP/1.1 " + intToString(_statusCode) + " " + _statusText + "\r\n"; | ||
| 106 | 114 | printInternal(statusLine, true); | |
| 107 | 115 | ||
| 108 | 116 | // Each header, like: "Host: myEsp32\r\n" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,8 @@ class HTTPResponse : public Print { | |||
| 33 | 33 | ||
| 34 | 34 | void setStatusCode(uint16_t statusCode); | |
| 35 | 35 | void setStatusText(std::string statusText); | |
| 36 | + uint16_t getStatusCode(); | ||
| 37 | + std::string getStatusText(); | ||
| 36 | 38 | void setHeader(std::string name, std::string value); | |
| 37 | 39 | bool isHeaderWritten(); | |
| 38 | 40 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments