The Request() function queues an HTTP request to this HTTP instance. Similar to Transmit() function in the EFI TCP driver. When the HTTP request is sent successfully, or if there is an error, Status in token will be updated and Event will be signaled. @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. @param[in] Token Pointer to storage contain
| 224 | Request()has not been completed successfully. |
| 225 | **/ |
| 226 | EFI_STATUS |
| 227 | EFIAPI |
| 228 | EfiHttpRequest ( |
| 229 | IN EFI_HTTP_PROTOCOL *This, |
| 230 | IN EFI_HTTP_TOKEN *Token |
| 231 | ) |
| 232 | { |
| 233 | EFI_HTTP_MESSAGE *HttpMsg; |
| 234 | EFI_HTTP_REQUEST_DATA *Request; |
| 235 | VOID *UrlParser; |
| 236 | EFI_STATUS Status; |
| 237 | CHAR8 *HostName; |
| 238 | UINTN HostNameSize; |
| 239 | UINT16 RemotePort; |
| 240 | HTTP_PROTOCOL *HttpInstance; |
| 241 | BOOLEAN Configure; |
| 242 | BOOLEAN ReConfigure; |
| 243 | BOOLEAN TlsConfigure; |
| 244 | CHAR8 *RequestMsg; |
| 245 | CHAR8 *Url; |
| 246 | UINTN UrlLen; |
| 247 | CHAR16 *HostNameStr; |
| 248 | HTTP_TOKEN_WRAP *Wrap; |
| 249 | CHAR8 *FileUrl; |
| 250 | UINTN RequestMsgSize; |
| 251 | EFI_HANDLE ImageHandle; |
| 252 | |
| 253 | // |
| 254 | // Initializations |
| 255 | // |
| 256 | Url = NULL; |
| 257 | UrlParser = NULL; |
| 258 | RemotePort = 0; |
| 259 | HostName = NULL; |
| 260 | RequestMsg = NULL; |
| 261 | HostNameStr = NULL; |
| 262 | Wrap = NULL; |
| 263 | FileUrl = NULL; |
| 264 | TlsConfigure = FALSE; |
| 265 | |
| 266 | if ((This == NULL) || (Token == NULL)) { |
| 267 | return EFI_INVALID_PARAMETER; |
| 268 | } |
| 269 | |
| 270 | HttpMsg = Token->Message; |
| 271 | if (HttpMsg == NULL) { |
| 272 | return EFI_INVALID_PARAMETER; |
| 273 | } |
| 274 | |
| 275 | Request = HttpMsg->Data.Request; |
| 276 | |
| 277 | // |
| 278 | // Only support GET, HEAD, DELETE, PATCH, PUT and POST method in current implementation. |
| 279 | // |
| 280 | if ((Request != NULL) && (Request->Method != HttpMethodGet) && |
| 281 | (Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) && |
| 282 | (Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) && |
| 283 | (Request->Method != HttpMethodPatch)) { |
nothing calls this directly
no test coverage detected