MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / startResponse

Method startResponse

Libraries/Http/HttpConnection.cpp:1098–1123  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------------- HttpResponse -------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1096// HttpResponse
1097//-------------------------------------------------------------------------------------------------------
1098Result HttpResponse::startResponse(int code)
1099{
1100 StringSpan reasonPhrase;
1101 switch (code)
1102 {
1103 case 100: reasonPhrase = "Continue"; break;
1104 case 101: reasonPhrase = "Switching Protocols"; break;
1105 case 200: reasonPhrase = "OK"; break;
1106 case 201: reasonPhrase = "Created"; break;
1107 case 204: reasonPhrase = "No Content"; break;
1108 case 206: reasonPhrase = "Partial Content"; break;
1109 case 301: reasonPhrase = "Moved Permanently"; break;
1110 case 302: reasonPhrase = "Found"; break;
1111 case 304: reasonPhrase = "Not Modified"; break;
1112 case 400: reasonPhrase = "Bad Request"; break;
1113 case 403: reasonPhrase = "Forbidden"; break;
1114 case 404: reasonPhrase = "Not Found"; break;
1115 case 405: reasonPhrase = "Method Not Allowed"; break;
1116 case 413: reasonPhrase = "Payload Too Large"; break;
1117 case 416: reasonPhrase = "Range Not Satisfiable"; break;
1118 case 426: reasonPhrase = "Upgrade Required"; break;
1119 case 500: reasonPhrase = "Internal Server Error"; break;
1120 default: return Result::Error("HttpResponse unsupported status code");
1121 }
1122 return startResponse(code, reasonPhrase);
1123}
1124
1125Result HttpResponse::startResponse(int code, StringSpan reasonPhrase)
1126{

Callers 15

blockingGetMethod · 0.80
blockingPostMethod · 0.80
blockingCustomHeadersMethod · 0.80
contentCodingPolicyMethod · 0.80
protocolPreferenceMethod · 0.80
proxyOptionsMethod · 0.80
methodCoverageMethod · 0.80
onEndMethod · 0.80
pollGetMethod · 0.80
pollConcurrentGetsMethod · 0.80

Calls 4

ErrorEnum · 0.50
ResultClass · 0.50
isEmptyMethod · 0.45
appendMethod · 0.45

Tested by 15

blockingGetMethod · 0.64
blockingPostMethod · 0.64
blockingCustomHeadersMethod · 0.64
contentCodingPolicyMethod · 0.64
protocolPreferenceMethod · 0.64
proxyOptionsMethod · 0.64
methodCoverageMethod · 0.64
onEndMethod · 0.64
pollGetMethod · 0.64
pollConcurrentGetsMethod · 0.64