Exemple #1
0
        public async Task <HttpClientResponse> GetResponseAsync()
        {
            stringBuffer.SetLength(0);
            string command = await HttpUtility.ReadLineAsync(bufferContext, stringBuffer);

            if (command == null)
            {
                return(null);
            }
            stringBuffer.SetLength(0);
            // read the headers
            HttpHeaders headers = new HttpHeaders();

            if (!await HttpUtility.ReadHeadersAsync(bufferContext, stringBuffer, headers))
            {
                return(null);
            }
            lastResponse = new HttpClientResponse(command, headers, bufferContext);
            return(lastResponse);
        }