public async Task TestSendRequest3() { var composer = new HttpRequestComposer(); composer.InitializeHttpRequest("", "www.google.com", "GET"); bool result = await composer.SendRequest(); Assert.AreEqual(result, true); }
public async Task TestSendRequest() { var composer = new HttpRequestComposer(); string rawRequest = "GET https://www.google.com/ HTTP/1.1\r\n" + "Host: www.google.com\r\n" + "Connection: keepalive\r\n" + "Accept: text / html,application / xhtml + xml,application / xml;q = 0.9,image / webp,*/*;q=0.8\r\n" + "User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36\r\n" + "Accept-Encoding: gzip, deflate\r\n" + "Accept-Language: enUS,en;q=0.8"; composer.ParseRawRequest(rawRequest); bool result = await composer.SendRequest(); Assert.AreEqual(result, true); }