MCPcopy Create free account
hub / github.com/Barracuda09/SATPI / getMethod

Method getMethod

src/StringConverter.cpp:183–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183std::string StringConverter::getMethod(const std::string &msg) {
184 // request line should be in the first line (method)
185 std::string::size_type nextline = 0;
186 const std::string line = StringConverter::getline(msg, nextline, "\r\n");
187 if (!line.empty()) {
188 std::string::const_iterator it = line.begin();
189 // remove any leading whitespace
190 while (*it == ' ') ++it;
191
192 // copy method (upper case)
193 std::string method;
194 while (*it != ' ') {
195 method += std::toupper(*it);
196 ++it;
197 }
198 return method;
199 }
200 return "";
201}
202
203std::string StringConverter::getContentFrom(const std::string &msg) {
204 const std::string parameter = StringConverter::getHeaderFieldParameter(msg, "Content-Length:");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected