MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / sendRequest

Method sendRequest

lib/AsyncHttpClient/src/AsyncHttpClient.cpp:1003–1152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1001}
1002
1003bool AsyncHttpClient::sendRequest()
1004{
1005 bool status = false;
1006 String request;
1007 const char* PROTOCOL = "HTTP";
1008 const char* SP = " ";
1009 const char* CRLF = "\r\n";
1010
1011 /* RFC2616
1012 * Request = Request-Line
1013 * * (( general-header
1014 * | request-header
1015 * | entity-header ) CRLF)
1016 * CRLF
1017 * [ message-body ]
1018 *
1019 */
1020
1021 /* Request-Line: Method SP Request-URI SP HTTP-Version CRLF */
1022
1023 /* Method */
1024 request += m_method;
1025 request += SP;
1026
1027 /* Request-URI = "*" | absoluteURI | abs_path | authority */
1028 if (true == m_uri.isEmpty())
1029 {
1030 request += "/";
1031 }
1032 else
1033 {
1034 request += m_uri;
1035 }
1036
1037 request += SP;
1038
1039 /* HTTP-Version */
1040 request += PROTOCOL;
1041 request += "/";
1042
1043 if (false == m_isHttpVer10)
1044 {
1045 request += "1.1";
1046 }
1047 else
1048 {
1049 request += "1.0";
1050 }
1051
1052 request += CRLF;
1053
1054 /* --- Add now the request headers. --- */
1055
1056 /* RFC2616 - general-header */
1057 /* Empty */
1058
1059 /* RFC2616 - request-header */
1060 request += "Host: ";

Callers

nothing calls this directly

Calls 4

c_strMethod · 0.80
isEmptyMethod · 0.45
lengthMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected